Couchbase C Client
3.3.13
Asynchronous C Client for Couchbase
|
Status codes returned by the library
uint32_t lcb_error_flags | ( | lcb_STATUS | err | ) |
Get error categories for a specific code.
err | the error received |
LCB_INTERNAL_API const char * lcb_strerror_short | ( | lcb_STATUS | error | ) |
Get a shorter textual description of an error message.
This is the constant name
lcb_STATUS lcb_errmap_default | ( | lcb_INSTANCE * | instance, |
lcb_U16 | code ) |
This may be used in conjunction with the errmap callback if it wishes to fallback for default behavior for the given code.
lcb_errmap_callback lcb_set_errmap_callback | ( | lcb_INSTANCE * | instance, |
lcb_errmap_callback | ) |
lcb_STATUS lcb_retry_strategy | ( | lcb_INSTANCE * | instance, |
lcb_RETRY_STRATEGY | strategy ) |
Set the global retry strategy.
A strategy is a function pointer (see typedef above) which takes a lcb_RETRY_REQUEST and an lcb_RETRY_REASON, and returns a lcb_RETRY_ACTION. There are a number of lcb_retry_reason_*** and lcb_retry_request_*** functions one can use to formulate a stragegy. The simplest possible strategy:
This sets should_retry to false for all requests. Below, we use the functions mentioned above to formulate a more nuanced strategy:
These 2 strategies are pre-defined for you to use, or you can formulate your own.
typedef lcb_STATUS(* lcb_errmap_callback) (lcb_INSTANCE *instance, lcb_U16 bincode) |
Callback for error mappings.
This will be invoked when requesting whether the user has a possible mapping for this error code.
This will be called for response codes which may be ambiguous in most use cases, or in cases where detailed response codes may be mapped to more generic ones.
enum lcb_STATUS |