20#include "gnunet_error_codes.h"
22#include <microhttpd.h>
28#define MHD_HTTP_UNINITIALIZED 0
71 .hint =
gettext_noop (
"Communication with service failed."),
83 .hint =
gettext_noop (
"Identifier already in use for another ego."),
89 .hint =
gettext_noop (
"The given ego is invalid or malformed."),
125 .hint =
gettext_noop (
"Zone does not contain any records."),
167 .hint =
gettext_noop (
"Record size exceeds maximum limit."),
173 .hint =
gettext_noop (
"There was an error in the database backend."),
179 .hint =
gettext_noop (
"Failed to store the given records."),
203 unsigned int lower = 0;
205 unsigned int mid = upper / 2;
206 while (lower <= upper)
208 mid = (upper + lower) / 2;
222 return "<no hint found>";
229 unsigned int lower = 0;
231 unsigned int mid = upper / 2;
232 while (lower <= upper)
234 mid = (upper + lower) / 2;
#define gettext_noop(String)
@ MHD_HTTP_BAD_REQUEST
Bad Request [RFC7231, Section 6.5.1].
@ MHD_HTTP_NOT_FOUND
Not Found [RFC7231, Section 6.5.4].
@ MHD_HTTP_INTERNAL_SERVER_ERROR
Internal Server Error [RFC7231, Section 6.6.1].
@ MHD_HTTP_CONFLICT
Conflict [RFC7231, Section 6.5.8].
GNUNET_ErrorCode
Taler error codes.
@ GNUNET_EC_NAMESTORE_NO_RESULTS
No results given.
@ GNUNET_EC_NAMESTORE_RECORD_DELETE_FAILED
Zone iteration failed.
@ GNUNET_EC_NAMESTORE_LABEL_INVALID
Label invalid or malformed.
@ GNUNET_EC_NAMESTORE_LOOKUP_ERROR
Failed to lookup record.
@ GNUNET_EC_IDENTITY_INVALID
The given ego is invalid or malformed.
@ GNUNET_EC_NAMESTORE_BACKEND_FAILED
There was an error in the database backend.
@ GNUNET_EC_NAMESTORE_ITERATION_FAILED
Zone iteration failed.
@ GNUNET_EC_NAMESTORE_ZONE_EMPTY
Zone does not contain any records.
@ GNUNET_EC_NAMESTORE_RECORD_TOO_BIG
Record size exceeds maximum limit.
@ GNUNET_EC_SERVICE_COMMUNICATION_FAILED
Communication with service failed.
@ GNUNET_EC_NAMESTORE_STORE_FAILED
Failed to store the given records.
@ GNUNET_EC_NAMESTORE_NO_LABEL_GIVEN
No label given.
@ GNUNET_EC_NAMESTORE_RECORD_DATA_INVALID
Record data invalid.
@ GNUNET_EC_NAMESTORE_NO_RECORDS_GIVEN
No records given.
@ GNUNET_EC_UNKNOWN
Unknown and unspecified error.
@ GNUNET_EC_NAMESTORE_ZONE_NOT_FOUND
Zone not found.
@ GNUNET_EC_NONE
No error (success).
@ GNUNET_EC_IDENTITY_NOT_FOUND
Ego not found.
@ GNUNET_EC_IDENTITY_NAME_CONFLICT
Identifier already in use for another ego.
@ GNUNET_EC_NAMESTORE_RECORD_EXISTS
Record already exists.
@ GNUNET_EC_NAMESTORE_UNKNOWN
Unknown namestore error.
@ GNUNET_EC_NAMESTORE_RECORD_NOT_FOUND
Record not found.
unsigned int GNUNET_ErrorCode_get_http_status_safe(enum GNUNET_ErrorCode ec)
Return HTTP status for a given error code that is guaranteed to work (no corner cases).
static const unsigned int code_hint_pairs_length
The length of code_hint_pairs.
#define MHD_HTTP_UNINITIALIZED
MHD does not define our value for 0 (client-side generated code).
const char * GNUNET_ErrorCode_get_hint(enum GNUNET_ErrorCode ec)
Returns a hint for a given error code.
unsigned int GNUNET_ErrorCode_get_http_status(enum GNUNET_ErrorCode ec)
Return HTTP status for a given error code.
static const struct ErrorCodeAndHint code_hint_pairs[]
The list of all error codes with their hints.
A pair containing an error code and its hint.
const char * hint
The hint.
enum GNUNET_ErrorCode ec
The error code.
unsigned int http_code
The HTTP status code.