= lcb_strerror(3couchbase) :doctype: manpage Trond Norbye NAME ---- lcb_strerror - Convert error code to textual representation SYNOPSIS -------- cc [ flag ... ] file... -lcouchbase [ library ... ] #include const char * lcb_strerror(lcb_t instance, lcb_error_t error); DESCRIPTION ----------- lcb_strerror() converts an error code to a textual representation. The instance parameter may be NULL if you don't have an instance to use (it is currently unused, but in the future you may get extra information). Refer to the file for more detailed error defintions Since version 2.3.0 error classifiers are now available to ease the programming model. Error classifiers define to the application a more actionable error category in order to advise on the best course of action for handling it. Error classifiers for each error code can be obtained using the various LCB_EIF* macros which accept the error code as their argument. Note that a single error may have more than one category. These macros are defined in : * LCB_EIFINPUT(err) This error is likely the result of bad input (i.e. invalid parameters) * LCB_EIFNET(err) This error is likely a result of a bad network (slow network, broken links) * LCB_EIFTMP(err) This error is likely a transient error and may disappear within a period of time * LCB_EIFDATA(err) This error is a negative reply from the server due to some data constraints not being satisfied (for example a missing key, or a CAS mismatch) * LCB_EIFPLUGIN(err) This error is thrown by an I/O plugin * LCB_EIFFATAL(err) This error is a fatal error and the lcb_t from which it was originated will likely not be usable anymore. RETURN VALUES ------------- lcb_strerror() returns a 0-terminated string of with an textual message representing the error. The memory return is owned by libcouchbase and only valid until the next call to libcouchbase (or returning control to libcouchbase from a callback). EXAMPLES -------- #include ... fprintf(stdout, "The textual string for LCB_SUCCESS is: %s\n", lcb_strerror(NULL, LCB_SUCCESS)); ... ATTRIBUTES ---------- See lcb_attributes(5) for descriptions of the following attributes: [options="header"] |======================================= | ATTRIBUTE TYPE | ATTRIBUTE VALUE | Interface Stability | Committed | MT-Level | MT-Safe |======================================= COPYRIGHT --------- Copyright 2010-2013 Couchbase, Inc. SEE ALSO -------- Learn more at . libcouchbase(3lib), lcb_attributes(5)