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