![]() |
C library for SOAP (Simple Object Access Protocol) |
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) |
nanoHTTP error handling
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.
| int herror_code | ( | herror_t | err | ) |
Returns the code of the error.
| const char* herror_func | ( | herror_t | err | ) |
| const char* herror_message | ( | herror_t | err | ) |
Returns the error message.
| herror_t herror_new | ( | const char * | func, | |
| int | errcode, | |||
| const char * | format, | |||
| ... | ||||
| ) |
Creates a new error structure.
| void herror_release | ( | herror_t | err | ) |
Frees the error structure.