Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 1 | /** |
Jeff Thompson | 7687dc0 | 2013-09-13 11:54:07 -0700 | [diff] [blame] | 2 | * Copyright (C) 2013 Regents of the University of California. |
| 3 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #include "errors.h" |
| 8 | |
| 9 | char *ndn_getErrorString(int error) |
| 10 | { |
| 11 | switch (error) { |
| 12 | case NDN_ERROR_success: |
| 13 | return "success"; |
| 14 | case NDN_ERROR_element_of_value_is_not_a_decimal_digit: |
| 15 | return "element of value is not a decimal digit"; |
| 16 | case NDN_ERROR_read_past_the_end_of_the_input: |
| 17 | return "read past the end of the input"; |
| 18 | case NDN_ERROR_the_first_header_octet_may_not_be_zero: |
| 19 | return "the first header octet may not be zero"; |
| 20 | case NDN_ERROR_header_type_is_not_a_DTAG: |
| 21 | return "header type is not a DTAG"; |
| 22 | case NDN_ERROR_did_not_get_the_expected_DTAG: |
| 23 | return "did not get the expected DTAG"; |
| 24 | case NDN_ERROR_did_not_get_the_expected_element_close: |
| 25 | return "did not get the expected element close"; |
| 26 | case NDN_ERROR_item_is_not_UDATA: |
| 27 | return "item is not UDATA"; |
| 28 | case NDN_ERROR_header_type_is_out_of_range: |
| 29 | return "header type is out of range"; |
| 30 | case NDN_ERROR_encodeTypeAndValue_miscalculated_N_encoding_bytes: |
| 31 | return "encodeTypeAndValue miscalculated N encoding bytes"; |
| 32 | case NDN_ERROR_read_a_component_past_the_maximum_number_of_components_allowed_in_the_name: |
| 33 | return "read a component past the maximum number of components allowed in the name"; |
Jeff Thompson | f326361 | 2013-07-09 12:23:36 -0700 | [diff] [blame] | 34 | case NDN_ERROR_read_an_entry_past_the_maximum_number_of_entries_allowed_in_the_exclude: |
| 35 | return "read an entry past the maximum number of entries allowed in the exclude"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 36 | case NDN_ERROR_findElementEnd_unexpected_close_tag: |
| 37 | return "findElementEnd unexpected close tag"; |
| 38 | case NDN_ERROR_cannot_store_more_header_bytes_than_the_size_of_headerBuffer: |
| 39 | return "cannot store more header bytes than the size of headerBuffer"; |
| 40 | case NDN_ERROR_findElementEnd_cannot_read_header_type_and_value: |
| 41 | return "findElementEnd cannot read header type and value"; |
| 42 | case NDN_ERROR_findElementEnd_unrecognized_header_type: |
| 43 | return "findElementEnd unrecognized header type"; |
| 44 | case NDN_ERROR_findElementEnd_unrecognized_state: |
| 45 | return "findElementEnd unrecognized state"; |
Jeff Thompson | 10ad12a | 2013-09-24 16:19:11 -0700 | [diff] [blame] | 46 | case NDN_ERROR_DynamicUInt8Array_realloc_function_pointer_not_supplied: |
| 47 | return "DynamicUInt8Array realloc function pointer not supplied"; |
| 48 | case NDN_ERROR_DynamicUInt8Array_realloc_failed: |
| 49 | return "DynamicUInt8Array realloc failed"; |
Jeff Thompson | f2e9aa0 | 2013-07-09 12:13:09 -0700 | [diff] [blame] | 50 | case NDN_ERROR_unrecognized_ndn_ExcludeType: |
| 51 | return "unrecognized ndn_ExcludeType"; |
Jeff Thompson | 7ed3e27 | 2013-08-16 19:15:30 -0700 | [diff] [blame] | 52 | case NDN_ERROR_unrecognized_ndn_ContentType: |
| 53 | return "unrecognized ndn_ContentType"; |
Jeff Thompson | 07029ec | 2013-07-11 11:12:44 -0700 | [diff] [blame] | 54 | case NDN_ERROR_unrecognized_ndn_KeyLocatorType: |
| 55 | return "unrecognized ndn_KeyLocatorType"; |
Jeff Thompson | 7329a13 | 2013-08-16 15:57:37 -0700 | [diff] [blame] | 56 | case NDN_ERROR_unrecognized_ndn_KeyNameType: |
| 57 | return "unrecognized ndn_KeyNameType"; |
Jeff Thompson | f0fea00 | 2013-07-30 17:22:42 -0700 | [diff] [blame] | 58 | case NDN_ERROR_decodeBinaryXmlKeyLocator_unrecognized_key_locator_type: |
| 59 | return "decodeBinaryXmlKeyLocator unrecognized key locator type"; |
Jeff Thompson | 0aa754a | 2013-07-17 17:42:28 -0700 | [diff] [blame] | 60 | case NDN_ERROR_unrecognized_ndn_SocketTransport: |
| 61 | return "unrecognized ndn_SocketTransport"; |
| 62 | case NDN_ERROR_SocketTransport_error_in_getaddrinfo: |
| 63 | return "SocketTransport error in getaddrinfo"; |
| 64 | case NDN_ERROR_SocketTransport_cannot_connect_to_socket: |
| 65 | return "SocketTransport cannot connect to socket"; |
| 66 | case NDN_ERROR_SocketTransport_socket_is_not_open: |
| 67 | return "SocketTransport socket is not open"; |
| 68 | case NDN_ERROR_SocketTransport_error_in_send: |
| 69 | return "SocketTransport error in send"; |
Jeff Thompson | 432c8be | 2013-08-09 16:16:08 -0700 | [diff] [blame] | 70 | case NDN_ERROR_SocketTransport_error_in_poll: |
| 71 | return "SocketTransport error in poll"; |
Jeff Thompson | 0aa754a | 2013-07-17 17:42:28 -0700 | [diff] [blame] | 72 | case NDN_ERROR_SocketTransport_error_in_recv: |
| 73 | return "SocketTransport error in recv"; |
Jeff Thompson | 5796388 | 2013-08-05 16:01:25 -0700 | [diff] [blame] | 74 | case NDN_ERROR_SocketTransport_error_in_close: |
| 75 | return "SocketTransport error in close"; |
Jeff Thompson | 0bcc786 | 2013-10-08 12:34:54 -0700 | [diff] [blame] | 76 | case NDN_ERROR_Name_component_does_not_begin_with_the_expected_marker: |
| 77 | return "Name component does not begin with the expected marker"; |
Jeff Thompson | ea94620 | 2013-10-18 14:35:32 -0700 | [diff] [blame] | 78 | case NDN_ERROR_Time_functions_are_not_supported_by_the_standard_library: |
| 79 | return "Time functions are not supported by the standard library"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 80 | default: |
| 81 | return "unrecognized ndn_Error code"; |
| 82 | } |
| 83 | } |