blob: a77a858ff859a58656822a4baa7760f44d49be96 [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:
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 Thompsonf3263612013-07-09 12:23:36 -070034 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 Thompson8b666002013-07-08 01:16:26 -070036 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 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:
51 return "unrecognized ndn_ExcludeType";
Jeff Thompson7ed3e272013-08-16 19:15:30 -070052 case NDN_ERROR_unrecognized_ndn_ContentType:
53 return "unrecognized ndn_ContentType";
Jeff Thompson07029ec2013-07-11 11:12:44 -070054 case NDN_ERROR_unrecognized_ndn_KeyLocatorType:
55 return "unrecognized ndn_KeyLocatorType";
Jeff Thompson7329a132013-08-16 15:57:37 -070056 case NDN_ERROR_unrecognized_ndn_KeyNameType:
57 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:
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 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 Thompson8b666002013-07-08 01:16:26 -070080 default:
81 return "unrecognized ndn_Error code";
82 }
83}