Go to the source code of this file.
Defines | |
#define | H_OK 0 |
#define | GENERAL_ERROR 1400 |
#define | GENERAL_INVALID_PARAM (GENERAL_ERROR + 1) |
#define | GENERAL_HEADER_PARSE_ERROR (GENERAL_ERROR + 2) |
#define | THREAD_ERROR 1500 |
#define | THREAD_BEGIN_ERROR (THREAD_ERROR) |
#define | FILE_ERROR 8000 |
#define | FILE_ERROR_OPEN (FILE_ERROR + 1) |
#define | FILE_ERROR_READ (FILE_ERROR + 2) |
Typedefs | |
typedef void * | herror_t |
Functions | |
herror_t | herror_new (const char *func, int errcode, const char *format,...) |
int | herror_code (herror_t err) |
const char * | herror_func (herror_t err) |
const char * | herror_message (herror_t err) |
void | herror_release (herror_t err) |
Almost all function will return a "herror_t" object. If the function returns with success this object is H_OK. Another herror_t object will be returned otherwise. Following functions can be used with a returned herror_t object:
Example:
herror_t err; if ((err = http_client_invoke("http://somewhere")) != H_OK) { printf("Message: %s\n", herror_message(err)); printf("Error code: %d\n", herror_code(err)); printf("In function: %s\n", herror_func(err)); herror_release(err); }
Note that you MUST call herror_release() to free the resources.
Definition in file nanohttp-error.h.
|
File errors Definition at line 87 of file nanohttp-error.h. |
|
Definition at line 88 of file nanohttp-error.h. Referenced by httpc_mime_send_file(), httpd_mime_send_file(), and soap_ctx_add_file(). |
|
Definition at line 89 of file nanohttp-error.h. Referenced by httpc_mime_send_file(), and httpd_mime_send_file(). |
|
General errors Definition at line 70 of file nanohttp-error.h. |
|
Definition at line 72 of file nanohttp-error.h. Referenced by hresponse_new_from_socket(). |
|
Definition at line 71 of file nanohttp-error.h. Referenced by soap_env_new_from_buffer(), soap_env_new_from_doc(), and soap_env_new_with_response(). |
|
|
Definition at line 80 of file nanohttp-error.h. |
|
Thread errors Definition at line 79 of file nanohttp-error.h. |
|
Definition at line 98 of file nanohttp-error.h. |
|
Returns the code of the error. Definition at line 85 of file nanohttp-error.c. References _herror_impl_t::errcode, and H_OK. Referenced by mime_streamreader_function(). |
|
Returns the name of the function, where the error was produced. Definition at line 96 of file nanohttp-error.c. References _herror_impl_t::func. Referenced by mime_streamreader_function(). |
|
|
|
Frees the error structure. Definition at line 118 of file nanohttp-error.c. References _herror_impl_t::func. Referenced by soap_nudp_server_run(), and soap_server_process(). |