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: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 13 | return "Success"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 14 | case NDN_ERROR_element_of_value_is_not_a_decimal_digit: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 15 | return "Element of value is not a decimal digit"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 16 | case NDN_ERROR_read_past_the_end_of_the_input: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 17 | return "Read past the end of the input"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 18 | case NDN_ERROR_the_first_header_octet_may_not_be_zero: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 19 | return "The first header octet may not be zero"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 20 | case NDN_ERROR_header_type_is_not_a_DTAG: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 21 | return "Header type is not a DTAG"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 22 | case NDN_ERROR_did_not_get_the_expected_DTAG: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 23 | return "Did not get the expected DTAG"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 24 | case NDN_ERROR_did_not_get_the_expected_element_close: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 25 | return "Did not get the expected element close"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 26 | case NDN_ERROR_item_is_not_UDATA: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 27 | return "Item is not UDATA"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 28 | case NDN_ERROR_header_type_is_out_of_range: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 29 | return "Header type is out of range"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 30 | case NDN_ERROR_encodeTypeAndValue_miscalculated_N_encoding_bytes: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 31 | return "EncodeTypeAndValue miscalculated N encoding bytes"; |
Jeff Thompson | e7ab944 | 2013-12-10 19:34:06 -0800 | [diff] [blame] | 32 | case NDN_ERROR_attempt_to_add_a_component_past_the_maximum_number_of_components_allowed_in_the_name: |
| 33 | return "Attempt to add 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: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 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: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 37 | return "FindElementEnd unexpected close tag"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 38 | case NDN_ERROR_cannot_store_more_header_bytes_than_the_size_of_headerBuffer: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 39 | return "Cannot store more header bytes than the size of headerBuffer"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 40 | case NDN_ERROR_findElementEnd_cannot_read_header_type_and_value: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 41 | return "FindElementEnd cannot read header type and value"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 42 | case NDN_ERROR_findElementEnd_unrecognized_header_type: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 43 | return "FindElementEnd unrecognized header type"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 44 | case NDN_ERROR_findElementEnd_unrecognized_state: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 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: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 51 | return "Unrecognized ndn_ExcludeType"; |
Jeff Thompson | 7ed3e27 | 2013-08-16 19:15:30 -0700 | [diff] [blame] | 52 | case NDN_ERROR_unrecognized_ndn_ContentType: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 53 | return "Unrecognized ndn_ContentType"; |
Jeff Thompson | 07029ec | 2013-07-11 11:12:44 -0700 | [diff] [blame] | 54 | case NDN_ERROR_unrecognized_ndn_KeyLocatorType: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 55 | return "Unrecognized ndn_KeyLocatorType"; |
Jeff Thompson | 7329a13 | 2013-08-16 15:57:37 -0700 | [diff] [blame] | 56 | case NDN_ERROR_unrecognized_ndn_KeyNameType: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 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: |
Jeff Thompson | 09159bb | 2013-11-05 12:11:10 -0800 | [diff] [blame] | 61 | return "Unrecognized ndn_SocketTransport"; |
Jeff Thompson | 0aa754a | 2013-07-17 17:42:28 -0700 | [diff] [blame] | 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 | f51f9a5 | 2013-10-18 16:21:48 -0700 | [diff] [blame] | 80 | case NDN_ERROR_Calendar_time_value_out_of_range: |
| 81 | return "Calendar time value out of range"; |
Jeff Thompson | 8b66600 | 2013-07-08 01:16:26 -0700 | [diff] [blame] | 82 | default: |
| 83 | return "unrecognized ndn_Error code"; |
| 84 | } |
| 85 | } |