blob: 152a295b4278707b98ea99e64acd1b2346a6906f [file] [log] [blame]
Jeff Thompson8b666002013-07-08 01:16:26 -07001/**
Jeff Thompson7687dc02013-09-13 11:54:07 -07002 * Copyright (C) 2013 Regents of the University of California.
3 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
Jeff Thompson8b666002013-07-08 01:16:26 -07004 * See COPYING for copyright and distribution information.
5 */
6
7#include "errors.h"
8
9char *ndn_getErrorString(int error)
10{
11 switch (error) {
12 case NDN_ERROR_success:
Jeff Thompson09159bb2013-11-05 12:11:10 -080013 return "Success";
Jeff Thompson8b666002013-07-08 01:16:26 -070014 case NDN_ERROR_element_of_value_is_not_a_decimal_digit:
Jeff Thompson09159bb2013-11-05 12:11:10 -080015 return "Element of value is not a decimal digit";
Jeff Thompson8b666002013-07-08 01:16:26 -070016 case NDN_ERROR_read_past_the_end_of_the_input:
Jeff Thompson09159bb2013-11-05 12:11:10 -080017 return "Read past the end of the input";
Jeff Thompson8b666002013-07-08 01:16:26 -070018 case NDN_ERROR_the_first_header_octet_may_not_be_zero:
Jeff Thompson09159bb2013-11-05 12:11:10 -080019 return "The first header octet may not be zero";
Jeff Thompson8b666002013-07-08 01:16:26 -070020 case NDN_ERROR_header_type_is_not_a_DTAG:
Jeff Thompson09159bb2013-11-05 12:11:10 -080021 return "Header type is not a DTAG";
Jeff Thompson8b666002013-07-08 01:16:26 -070022 case NDN_ERROR_did_not_get_the_expected_DTAG:
Jeff Thompson09159bb2013-11-05 12:11:10 -080023 return "Did not get the expected DTAG";
Jeff Thompson8b666002013-07-08 01:16:26 -070024 case NDN_ERROR_did_not_get_the_expected_element_close:
Jeff Thompson09159bb2013-11-05 12:11:10 -080025 return "Did not get the expected element close";
Jeff Thompson8b666002013-07-08 01:16:26 -070026 case NDN_ERROR_item_is_not_UDATA:
Jeff Thompson09159bb2013-11-05 12:11:10 -080027 return "Item is not UDATA";
Jeff Thompson8b666002013-07-08 01:16:26 -070028 case NDN_ERROR_header_type_is_out_of_range:
Jeff Thompson09159bb2013-11-05 12:11:10 -080029 return "Header type is out of range";
Jeff Thompson8b666002013-07-08 01:16:26 -070030 case NDN_ERROR_encodeTypeAndValue_miscalculated_N_encoding_bytes:
Jeff Thompson09159bb2013-11-05 12:11:10 -080031 return "EncodeTypeAndValue miscalculated N encoding bytes";
Jeff Thompson8b666002013-07-08 01:16:26 -070032 case NDN_ERROR_read_a_component_past_the_maximum_number_of_components_allowed_in_the_name:
Jeff Thompson09159bb2013-11-05 12:11:10 -080033 return "Read a component past the maximum number of components allowed in the name";
Jeff Thompsonf3263612013-07-09 12:23:36 -070034 case NDN_ERROR_read_an_entry_past_the_maximum_number_of_entries_allowed_in_the_exclude:
Jeff Thompson09159bb2013-11-05 12:11:10 -080035 return "Read an entry past the maximum number of entries allowed in the exclude";
Jeff Thompson8b666002013-07-08 01:16:26 -070036 case NDN_ERROR_findElementEnd_unexpected_close_tag:
Jeff Thompson09159bb2013-11-05 12:11:10 -080037 return "FindElementEnd unexpected close tag";
Jeff Thompson8b666002013-07-08 01:16:26 -070038 case NDN_ERROR_cannot_store_more_header_bytes_than_the_size_of_headerBuffer:
Jeff Thompson09159bb2013-11-05 12:11:10 -080039 return "Cannot store more header bytes than the size of headerBuffer";
Jeff Thompson8b666002013-07-08 01:16:26 -070040 case NDN_ERROR_findElementEnd_cannot_read_header_type_and_value:
Jeff Thompson09159bb2013-11-05 12:11:10 -080041 return "FindElementEnd cannot read header type and value";
Jeff Thompson8b666002013-07-08 01:16:26 -070042 case NDN_ERROR_findElementEnd_unrecognized_header_type:
Jeff Thompson09159bb2013-11-05 12:11:10 -080043 return "FindElementEnd unrecognized header type";
Jeff Thompson8b666002013-07-08 01:16:26 -070044 case NDN_ERROR_findElementEnd_unrecognized_state:
Jeff Thompson09159bb2013-11-05 12:11:10 -080045 return "FindElementEnd unrecognized state";
Jeff Thompson10ad12a2013-09-24 16:19:11 -070046 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 Thompsonf2e9aa02013-07-09 12:13:09 -070050 case NDN_ERROR_unrecognized_ndn_ExcludeType:
Jeff Thompson09159bb2013-11-05 12:11:10 -080051 return "Unrecognized ndn_ExcludeType";
Jeff Thompson7ed3e272013-08-16 19:15:30 -070052 case NDN_ERROR_unrecognized_ndn_ContentType:
Jeff Thompson09159bb2013-11-05 12:11:10 -080053 return "Unrecognized ndn_ContentType";
Jeff Thompson07029ec2013-07-11 11:12:44 -070054 case NDN_ERROR_unrecognized_ndn_KeyLocatorType:
Jeff Thompson09159bb2013-11-05 12:11:10 -080055 return "Unrecognized ndn_KeyLocatorType";
Jeff Thompson7329a132013-08-16 15:57:37 -070056 case NDN_ERROR_unrecognized_ndn_KeyNameType:
Jeff Thompson09159bb2013-11-05 12:11:10 -080057 return "Unrecognized ndn_KeyNameType";
Jeff Thompsonf0fea002013-07-30 17:22:42 -070058 case NDN_ERROR_decodeBinaryXmlKeyLocator_unrecognized_key_locator_type:
59 return "decodeBinaryXmlKeyLocator unrecognized key locator type";
Jeff Thompson0aa754a2013-07-17 17:42:28 -070060 case NDN_ERROR_unrecognized_ndn_SocketTransport:
Jeff Thompson09159bb2013-11-05 12:11:10 -080061 return "Unrecognized ndn_SocketTransport";
Jeff Thompson0aa754a2013-07-17 17:42:28 -070062 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 Thompson432c8be2013-08-09 16:16:08 -070070 case NDN_ERROR_SocketTransport_error_in_poll:
71 return "SocketTransport error in poll";
Jeff Thompson0aa754a2013-07-17 17:42:28 -070072 case NDN_ERROR_SocketTransport_error_in_recv:
73 return "SocketTransport error in recv";
Jeff Thompson57963882013-08-05 16:01:25 -070074 case NDN_ERROR_SocketTransport_error_in_close:
75 return "SocketTransport error in close";
Jeff Thompson0bcc7862013-10-08 12:34:54 -070076 case NDN_ERROR_Name_component_does_not_begin_with_the_expected_marker:
77 return "Name component does not begin with the expected marker";
Jeff Thompsonea946202013-10-18 14:35:32 -070078 case NDN_ERROR_Time_functions_are_not_supported_by_the_standard_library:
79 return "Time functions are not supported by the standard library";
Jeff Thompsonf51f9a52013-10-18 16:21:48 -070080 case NDN_ERROR_Calendar_time_value_out_of_range:
81 return "Calendar time value out of range";
Jeff Thompson8b666002013-07-08 01:16:26 -070082 default:
83 return "unrecognized ndn_Error code";
84 }
85}