From 80e29b53bbcd0bbc3b9397d904126f2789564550 Mon Sep 17 00:00:00 2001 From: Melinda Shore Date: Wed, 11 Dec 2013 18:06:53 -0800 Subject: [PATCH] reverted error text to spec --- src/getdns/getdns.h | 20 ++++++++++---------- src/getdns_error.c | 23 +++++++++++++---------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/getdns/getdns.h b/src/getdns/getdns.h index 0ef5c5f3..7c98c14f 100644 --- a/src/getdns/getdns.h +++ b/src/getdns/getdns.h @@ -53,25 +53,25 @@ struct event_base; #define GETDNS_RETURN_GENERIC_ERROR 1 #define GETDNS_RETURN_GENERIC_ERROR_TEXT "Generic error" #define GETDNS_RETURN_BAD_DOMAIN_NAME 300 -#define GETDNS_RETURN_BAD_DOMAIN_NAME_TEXT "Badly-formed domain name" +#define GETDNS_RETURN_BAD_DOMAIN_NAME_TEXT "Badly-formed domain name in first argument" #define GETDNS_RETURN_BAD_CONTEXT 301 -#define GETDNS_RETURN_BAD_CONTEXT_TEXT "Bad context type" +#define GETDNS_RETURN_BAD_CONTEXT_TEXT "Bad value for a context type" #define GETDNS_RETURN_CONTEXT_UPDATE_FAIL 302 -#define GETDNS_RETURN_CONTEXT_UPDATE_FAIL_TEXT "Context update failure" +#define GETDNS_RETURN_CONTEXT_UPDATE_FAIL_TEXT "Did not update the context" #define GETDNS_RETURN_UNKNOWN_TRANSACTION 303 -#define GETDNS_RETURN_UNKNOWN_TRANSACTION_TEXT "Unknown transaction id" +#define GETDNS_RETURN_UNKNOWN_TRANSACTION_TEXT "An attempt was made to cancel a callback with a transaction_id that is not recognized" #define GETDNS_RETURN_NO_SUCH_LIST_ITEM 304 -#define GETDNS_RETURN_NO_SUCH_LIST_ITEM_TEXT "List index out of bounds" +#define GETDNS_RETURN_NO_SUCH_LIST_ITEM_TEXT "A helper function for lists had an index argument that was too high." #define GETDNS_RETURN_NO_SUCH_DICT_NAME 305 -#define GETDNS_RETURN_NO_SUCH_DICT_NAME_TEXT "Key not found in dict" +#define GETDNS_RETURN_NO_SUCH_DICT_NAME_TEXT "A helper function for dicts had a name argument that for a name that is not in the dict." #define GETDNS_RETURN_WRONG_TYPE_REQUESTED 306 -#define GETDNS_RETURN_WRONG_TYPE_REQUESTED_TEXT "Incorrect type in request" +#define GETDNS_RETURN_WRONG_TYPE_REQUESTED_TEXT "A helper function was supposed to return a certain type for an item, but the wrong type was given." #define GETDNS_RETURN_NO_SUCH_EXTENSION 307 -#define GETDNS_RETURN_NO_SUCH_EXTENSION_TEXT "Invalid extension name" +#define GETDNS_RETURN_NO_SUCH_EXTENSION_TEXT "A name in the extensions dict is not a valid extension." #define GETDNS_RETURN_EXTENSION_MISFORMAT 308 -#define GETDNS_RETURN_EXTENSION_MISFORMAT_TEXT "Extension format error" +#define GETDNS_RETURN_EXTENSION_MISFORMAT_TEXT "One or more of the extensions is has a bad format." #define GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED 309 -#define GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED_TEXT "Query with DNSSEC extensions and stub resolution not permitted" +#define GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED_TEXT "A query was made with a context that is using stub resolution and a DNSSEC extension specified." #define GETDNS_RETURN_MEMORY_ERROR 310 #define GETDNS_RETURN_MEMORY_ERROR_TEXT "Unable to allocate the memory required." /** @} diff --git a/src/getdns_error.c b/src/getdns_error.c index e442a5cf..c3282dc8 100644 --- a/src/getdns_error.c +++ b/src/getdns_error.c @@ -34,33 +34,36 @@ getdns_lookup_table getdns_error_str[] = { , {GETDNS_RETURN_GENERIC_ERROR, "Generic error"} , - {GETDNS_RETURN_BAD_DOMAIN_NAME, "Badly-formed domain name"} + {GETDNS_RETURN_BAD_DOMAIN_NAME, "Badly-formed domain name in first argument"} , - {GETDNS_RETURN_BAD_CONTEXT, "Bad context type"} + {GETDNS_RETURN_BAD_CONTEXT, "Bad value for a context type"} , - {GETDNS_RETURN_CONTEXT_UPDATE_FAIL, "Context update failure"} + {GETDNS_RETURN_CONTEXT_UPDATE_FAIL, "Did not update the context"} , {GETDNS_RETURN_UNKNOWN_TRANSACTION, - "Unknown transaction id"} + "An attempt was made to cancel a callback with a transaction_id that is not recognized"} , {GETDNS_RETURN_NO_SUCH_LIST_ITEM, - "List index out of bounds"} + "A helper function for lists had an index argument that was too high."} , {GETDNS_RETURN_NO_SUCH_DICT_NAME, - "Key not found in dict"} + "A helper function for dicts had a name argument that for a name that is not in the dict."} , {GETDNS_RETURN_WRONG_TYPE_REQUESTED, - "Incorrect type in request"} + "A helper function was supposed to return a certain type for an item, but the wrong type was given."} , {GETDNS_RETURN_NO_SUCH_EXTENSION, - "Invalid extension name"} + "A name in the extensions dict is not a valid extension."} , {GETDNS_RETURN_EXTENSION_MISFORMAT, - "Extension format error"} + "One or more of the extensions is has a bad format."} , {GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED, - "Query with DNSSEC extensions andstub resolution not permitted"} + "A query was made with a context that is using stub resolution and a DNSSEC extension specified."} , + {GETDNS_RETURN_MEMORY_ERROR, + "Unable to allocate the memory required."} + , {0, ""} };