Couchbase C Client  2.10.0
Asynchronous C Client for Couchbase
error.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright 2012 Couchbase, Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
23 #ifndef LIBCOUCHBASE_ERROR_H
24 #define LIBCOUCHBASE_ERROR_H 1
25 
26 #ifndef LIBCOUCHBASE_COUCHBASE_H
27 #error "Include libcouchbase/couchbase.h instead"
28 #endif
29 
30 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
51 typedef enum {
54 
57 
60 
63 
66 
69 
72 
75 
78 
87 
88 /* PRIVATE. This is just here to instruct/inform users to use the more detailed codes */
89 #define LCB__ERR_USEDETAILS \
90  "Enable detailed error codes (via LCB_CNTL_DETAILED_ERRCODES, or via " \
91  "`detailed_errcodes` in the connection string) and/or enable logging to " \
92  "get more information"
93 
103 #define LCB_XERR(X) \
104  \
105  X(LCB_SUCCESS, 0x00, 0, "Success (Not an error)") \
106  \
107  X(LCB_AUTH_CONTINUE, 0x01, LCB_ERRTYPE_INTERNAL|LCB_ERRTYPE_FATAL|LCB_ERRTYPE_SRVGEN, \
108  "Error code used internally within libcouchbase for SASL auth. Should " \
109  "not be visible from the API") \
110  \
111  \
118  X(LCB_AUTH_ERROR, 0x02, LCB_ERRTYPE_FATAL|LCB_ERRTYPE_INPUT, \
119  "Authentication failed. You may have provided an invalid " \
120  "username/password combination") \
121  \
122  \
125  X(LCB_DELTA_BADVAL, 0x03, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN, \
126  "The value requested to be incremented is not stored as a number") \
127  \
128  \
131  X(LCB_E2BIG, 0x04, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN, \
132  "The object requested is too big to store in the server") \
133  \
134  X(LCB_EBUSY, 0x05, LCB_ERRTYPE_TRANSIENT, "The server is busy. Try again later") \
135  \
136  X(LCB_EINTERNAL, 0x06, LCB_ERRTYPE_INTERNAL, "Internal libcouchbase error") \
137  \
138  \
141  X(LCB_EINVAL, 0x07, LCB_ERRTYPE_INPUT, "Invalid input/arguments") \
142  \
143  \
145  X(LCB_ENOMEM, 0x08, LCB_ERRTYPE_TRANSIENT, \
146  "The server is out of memory. Try again later") \
147  \
148  X(LCB_ERANGE, 0x09, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN, \
149  "Invalid range") \
150  \
151  \
152  X(LCB_ERROR, 0x0A, 0, "Generic error") \
153  \
154  \
160  X(LCB_ETMPFAIL, 0x0B, LCB_ERRTYPE_TRANSIENT|LCB_ERRTYPE_SRVLOAD|LCB_ERRTYPE_SRVGEN, \
161  "Temporary failure received from server. Try again later") \
162  \
163  \
167  X(LCB_KEY_EEXISTS, 0x0C, LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN, \
168  "The key already exists in the server. If you have supplied a CAS then " \
169  "the key exists with a CAS value different than specified") \
170  \
171  \
172  X(LCB_KEY_ENOENT, 0x0D, LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN, \
173  "The key does not exist on the server") \
174  \
175  \
176  X(LCB_DLOPEN_FAILED, 0x0E, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_FATAL|LCB_ERRTYPE_PLUGIN, \
177  "Could not locate plugin library") \
178  \
179  \
180  X(LCB_DLSYM_FAILED, 0x0F, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_FATAL|LCB_ERRTYPE_PLUGIN, \
181  "Required plugin initializer not found") \
182  \
183  \
189  X(LCB_NETWORK_ERROR, 0x10, LCB_ERRTYPE_NETWORK, \
190  "Generic network failure. " LCB__ERR_USEDETAILS) \
191  \
192  \
195  X(LCB_NOT_MY_VBUCKET, 0x11, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_TRANSIENT|LCB_ERRTYPE_SRVGEN, \
196  "The server which received this command claims it is not hosting this key") \
197  \
198  \
200  X(LCB_NOT_STORED, 0x12, LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN, \
201  "Item not stored (did you try to append/prepend to a missing key?)") \
202  \
203  \
210  X(LCB_NOT_SUPPORTED, 0x13, 0, "Operation not supported") \
211  \
212  \
214  X(LCB_UNKNOWN_COMMAND, 0x14, LCB_ERRTYPE_SRVGEN, "Unknown command") \
215  \
216  \
221  X(LCB_UNKNOWN_HOST, 0x15, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_INPUT, \
222  "DNS/Hostname lookup failed") \
223  \
224  \
225  X(LCB_PROTOCOL_ERROR, 0x16, LCB_ERRTYPE_NETWORK, \
226  "Data received on socket was not in the expected format") \
227  \
228  \
231  X(LCB_ETIMEDOUT, 0x17, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_TRANSIENT, \
232  "Client-Side timeout exceeded for operation. Inspect network conditions " \
233  "or increase the timeout") \
234  \
235  \
236  X(LCB_CONNECT_ERROR, 0x18, LCB_ERRTYPE_NETWORK, \
237  "Error while establishing TCP connection. " LCB__ERR_USEDETAILS) \
238  \
239  \
241  X(LCB_BUCKET_ENOENT, 0x19, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_FATAL, \
242  "The bucket requested does not exist") \
243  \
244  \
245  X(LCB_CLIENT_ENOMEM, 0x1A, LCB_ERRTYPE_FATAL, \
246  "Memory allocation for libcouchbase failed. Severe problems ahead") \
247  \
248  \
250  X(LCB_CLIENT_ENOCONF, 0x1B, LCB_ERRTYPE_TRANSIENT, \
251  "Client not bootstrapped. Ensure bootstrap/connect was attempted and was successful") \
252  \
253  X(LCB_EBADHANDLE, 0x1C, LCB_ERRTYPE_INPUT, \
254  "Bad handle type for operation. " \
255  "You cannot perform administrative operations on a data handle, or data "\
256  "operations on a cluster handle") \
257  \
258  X(LCB_SERVER_BUG, 0x1D, 0, "Encountered a server bug") \
259  \
260  X(LCB_PLUGIN_VERSION_MISMATCH, 0x1E, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_FATAL|LCB_ERRTYPE_PLUGIN, \
261  "This version of libcouchbase cannot load the specified plugin") \
262  \
263  X(LCB_INVALID_HOST_FORMAT, 0x1F, LCB_ERRTYPE_INPUT, \
264  "Hostname specified for URI is in an invalid format") \
265  \
266  X(LCB_INVALID_CHAR, 0x20, LCB_ERRTYPE_INPUT, "Illegal characted") \
267  \
268  \
271  X(LCB_DURABILITY_ETOOMANY, 0x21, LCB_ERRTYPE_INPUT, \
272  "Durability constraints requires more nodes/replicas than the cluster "\
273  "configuration allows. Durability constraints will never be satisfied") \
274  \
275  \
278  X(LCB_DUPLICATE_COMMANDS, 0x22, LCB_ERRTYPE_INPUT, \
279  "The same key was specified more than once in the command list") \
280  \
281  \
284  X(LCB_NO_MATCHING_SERVER, 0x23, LCB_ERRTYPE_TRANSIENT, \
285  "The node the request was mapped to does not exist in the current cluster " \
286  "map. This may be the result of a failover.") \
287  \
288  \
292  X(LCB_BAD_ENVIRONMENT, 0x24, LCB_ERRTYPE_FATAL|LCB_ERRTYPE_INPUT, \
293  "The value for an environment variable recognized by libcouchbase was " \
294  "specified in an incorrect format. Check your environment for entries " \
295  "starting with 'LCB_' or 'LIBCOUCHBASE_'") \
296  \
297  X(LCB_BUSY, 0x25, LCB_ERRTYPE_INTERNAL, "Busy. This is an internal error") \
298  \
299  \
300  X(LCB_INVALID_USERNAME, 0x26, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_FATAL, \
301  "The username must match the bucket name (or be NULL) for data access") \
302  \
303  X(LCB_CONFIG_CACHE_INVALID, 0x27, LCB_ERRTYPE_INPUT, \
304  "The contents of the configuration cache file were invalid. Configuration " \
305  "will be fetched from the network") \
306  \
307  \
310  X(LCB_SASLMECH_UNAVAILABLE, 0x28, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_FATAL, \
311  "The requested SASL mechanism was not supported by the server. Either " \
312  "upgrade the server or change the mechanism requirements") \
313  \
314  \
316  X(LCB_TOO_MANY_REDIRECTS, 0x29, LCB_ERRTYPE_NETWORK, \
317  "Maximum allowed number of redirects reached. See lcb_cntl and the "\
318  "LCB_CNTL_MAX_REDIRECTS option to modify this limit") \
319  \
320  \
325  X(LCB_MAP_CHANGED, 0x2A, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_TRANSIENT, \
326  "The cluster map has changed and this operation could not be completed " \
327  "or retried internally. Try this operation again") \
328  \
329  \
331  X(LCB_INCOMPLETE_PACKET, 0x2B, LCB_ERRTYPE_TRANSIENT|LCB_ERRTYPE_INPUT, \
332  "Incomplete packet was passed to forward function") \
333  \
334  \
337  X(LCB_ECONNREFUSED, 0x2C, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_TRANSIENT, \
338  "The remote host refused the connection. Is the service up?") \
339  \
340  \
344  X(LCB_ESOCKSHUTDOWN, 0x2D, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_TRANSIENT, \
345  "The remote host closed the connection") \
346  \
347  \
351  X(LCB_ECONNRESET, 0x2E, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_TRANSIENT, \
352  "The connection was forcibly reset by the remote host") \
353  \
354  \
362  X(LCB_ECANTGETPORT, 0x2F, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_FATAL, \
363  "Could not assign a local port for this socket. For client sockets this means " \
364  "there are too many TCP sockets open") \
365  \
366  \
373  X(LCB_EFDLIMITREACHED, 0x30, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_FATAL, \
374  "The system or process has reached its maximum number of file descriptors") \
375  \
376  \
380  X(LCB_ENETUNREACH, 0x31, LCB_ERRTYPE_NETWORK|LCB_ERRTYPE_TRANSIENT, \
381  "The remote host was unreachable - is your network OK?") \
382  \
383  \
385  X(LCB_ECTL_UNKNOWN, 0x32, LCB_ERRTYPE_INPUT, \
386  "Control code passed was unrecognized") \
387  \
388  \
394  X(LCB_ECTL_UNSUPPMODE, 0x33, LCB_ERRTYPE_INPUT, \
395  "Invalid modifier for cntl operation (e.g. tried to read a write-only value") \
396  \
397  \
402  X(LCB_ECTL_BADARG, 0x34, LCB_ERRTYPE_INPUT, \
403  "Argument passed to cntl was badly formatted") \
404  \
405  \
407  X(LCB_EMPTY_KEY, 0x35, LCB_ERRTYPE_INPUT, \
408  "An empty key was passed to an operation") \
409  \
410  \
414  X(LCB_SSL_ERROR, 0x36, LCB_ERRTYPE_FATAL, \
415  "A generic error related to the SSL subsystem was encountered. Enable logging " \
416  "to see more details") \
417  \
418  \
421  X(LCB_SSL_CANTVERIFY, 0x37, LCB_ERRTYPE_FATAL, \
422  "Client could not verify server's certificate") \
423  \
424  X(LCB_SCHEDFAIL_INTERNAL, 0x38, 0, \
425  "Internal error used for destroying unscheduled command data") \
426  \
427  \
432  X(LCB_CLIENT_FEATURE_UNAVAILABLE, 0x39, LCB_ERRTYPE_INPUT, \
433  "The requested feature is not supported by the client, either because of " \
434  "settings in the configured instance, or because of options disabled at " \
435  "the time the library was compiled") \
436  \
437  \
439  X(LCB_OPTIONS_CONFLICT, 0x3A, LCB_ERRTYPE_INPUT, \
440  "The operation structure contains conflicting options") \
441  \
442  \
444  X(LCB_HTTP_ERROR, 0x3B, 0, \
445  "HTTP Operation failed. Inspect status code for details") \
446  \
447  \
449  X(LCB_DURABILITY_NO_MUTATION_TOKENS, 0x3C, LCB_ERRTYPE_INPUT, \
450  "The given item does not have a mutation token associated with it. " \
451  "this is either because fetching mutation tokens was not enabled, or " \
452  "you are trying to check on something not stored by this instance") \
453  \
454  \
455  X(LCB_UNKNOWN_MEMCACHED_ERROR, 0x3D, LCB_ERRTYPE_SRVGEN, \
456  "The server replied with an unrecognized status code. A newer version " \
457  "of this library may be able to decode it") \
458  \
459  \
460  X(LCB_MUTATION_LOST, 0x3E, LCB_ERRTYPE_SRVGEN,\
461  "The given mutation has been permanently lost due to the node failing " \
462  "before replication") \
463  \
464  X(LCB_SUBDOC_PATH_ENOENT, 0x3F, \
465  LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
466  "Sub-document path does not exist") \
467  \
468  X(LCB_SUBDOC_PATH_MISMATCH, 0x40,\
469  LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
470  "Type of element in sub-document path conflicts with type in document") \
471  \
472  X(LCB_SUBDOC_PATH_EINVAL, 0x41, \
473  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
474  "Malformed sub-document path") \
475  \
476  X(LCB_SUBDOC_PATH_E2BIG, 0x42, \
477  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
478  "Sub-document contains too many components") \
479  \
480  X(LCB_SUBDOC_DOC_E2DEEP, 0x43,\
481  LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
482  "Existing document contains too many levels of nesting") \
483  \
484  X(LCB_SUBDOC_VALUE_CANTINSERT, 0x44, \
485  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
486  "Subdocument operation would invalidate the JSON") \
487  \
488  X(LCB_SUBDOC_DOC_NOTJSON, 0x45,\
489  LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
490  "Existing document is not valid JSON") \
491  \
492  X(LCB_SUBDOC_NUM_ERANGE, 0x46, \
493  LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
494  "The existing numeric value is too large") \
495  \
496  X(LCB_SUBDOC_BAD_DELTA, 0x47,\
497  LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
498  "Delta must be numeric, within the 64 bit signed range, and non-zero") \
499  \
500  X(LCB_SUBDOC_PATH_EEXISTS, 0x48,\
501  LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
502  "The given path already exists in the document") \
503  \
504  X(LCB_SUBDOC_MULTI_FAILURE, 0x49,\
505  LCB_ERRTYPE_DATAOP|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
506  "Could not execute one or more multi lookups or mutations") \
507  \
508  X(LCB_SUBDOC_VALUE_E2DEEP, 0x4A,\
509  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
510  "Value is too deep to insert") \
511  \
512  X(LCB_EINVAL_MCD, 0x4B, LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_INTERNAL, \
513  "A badly formatted packet was sent to the server. Please report this in a bug") \
514  \
515  X(LCB_EMPTY_PATH, 0x4C, LCB_ERRTYPE_INPUT, "Missing subdocument path") \
516  \
517  X(LCB_UNKNOWN_SDCMD, 0x4D, LCB_ERRTYPE_INPUT, "Unknown subdocument command") \
518  \
519  X(LCB_ENO_COMMANDS, 0x4E, LCB_ERRTYPE_INPUT, "No commands specified") \
520  \
521  X(LCB_QUERY_ERROR, 0x4F, LCB_ERRTYPE_SRVGEN, \
522  "Query execution failed. Inspect raw response object for information") \
523  \
524  X(LCB_GENERIC_TMPERR, 0x50, LCB_ERRTYPE_TRANSIENT|LCB_ERRTYPE_SRVGEN, \
525  "Generic temporary error received from server") \
526  \
527  X(LCB_GENERIC_SUBDOCERR, 0x51, LCB_ERRTYPE_SUBDOC|LCB_ERRTYPE_SRVGEN, \
528  "Generic subdocument error received from server") \
529  \
530  X(LCB_GENERIC_CONSTRAINT_ERR, 0x52, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN, \
531  "Generic constraint error received from server") \
532  \
533  X(LCB_NAMESERVER_ERROR, 0x53, LCB_ERRTYPE_NETWORK, \
534  "Invalid reply received from nameserver") \
535  \
536  X(LCB_NOT_AUTHORIZED, 0x54, LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN, \
537  "Not authorized for operation") \
538  \
539  X(LCB_SUBDOC_INVALID_COMBO, 0x55, \
540  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
541  "An invalid combination of commands was specified") \
542  \
543  X(LCB_SUBDOC_MULTI_PATH_FAILURE, 0x56, \
544  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
545  "Specified key was successfully found, but one or more path operations failed") \
546  \
547  X(LCB_SUBDOC_SUCCESS_DELETED, 0x57, \
548  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
549  "The operation completed successfully, but operated on a deleted document") \
550  \
551  X(LCB_SUBDOC_XATTR_INVALID_FLAG_COMBO, 0x58, \
552  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
553  "The combination of the subdoc flags for the xattrs is not valid") \
554  \
555  X(LCB_SUBDOC_XATTR_INVALID_KEY_COMBO, 0x59, \
556  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
557  "Only a single xattr key may be accessed at the same time") \
558  \
559  X(LCB_SUBDOC_XATTR_UNKNOWN_MACRO, 0x5a, \
560  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
561  "The server has no knowledge of the requested macro") \
562  \
563  X(LCB_SUBDOC_XATTR_UNKNOWN_VATTR, 0x5b, \
564  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
565  "The server has no knowledge of the requested virtual xattr") \
566  \
567  X(LCB_SUBDOC_XATTR_CANT_MODIFY_VATTR, 0x5c, \
568  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
569  "Virtual xattrs cannot be modified") \
570  \
571  X(LCB_SUBDOC_MULTI_PATH_FAILURE_DELETED, 0x5d, \
572  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
573  "Specified key was found as a deleted document, but one or more path operations failed") \
574  \
575  X(LCB_SUBDOC_INVALID_XATTR_ORDER, 0x5e, \
576  LCB_ERRTYPE_INPUT|LCB_ERRTYPE_SRVGEN|LCB_ERRTYPE_SUBDOC, \
577  "According to the spec all xattr commands should come first, followed by the commands for the document body")
578 
580 typedef enum {
581  #define X(n, v, cls, s) n = v,
583  #undef X
585  #ifdef LIBCOUCHBASE_INTERNAL
589  LCB_MAX_ERROR_VAL,
590  #endif
591 
593  LCB_MAX_ERROR = 0x1000
595 
597 #define LCB_CLIENT_ETMPFAIL LCB_CLIENT_ENOCONF
600 #define LCB_EIFINPUT(e) (lcb_get_errtype(e) & LCB_ERRTYPE_INPUT)
601 
603 #define LCB_EIFNET(e) (lcb_get_errtype(e) & LCB_ERRTYPE_NETWORK)
604 
606 #define LCB_EIFFATAL(e) (lcb_get_errtype(e) & LCB_ERRTYPE_FATAL)
607 
609 #define LCB_EIFTMP(e) (lcb_get_errtype(e) & LCB_ERRTYPE_TRANSIENT)
610 
612 #define LCB_EIFDATA(e) (lcb_get_errtype(e) & LCB_ERRTYPE_DATAOP)
613 
615 #define LCB_EIFPLUGIN(e) (lcb_get_errtype(e) & LCB_ERRTYPE_PLUGIN)
616 #define LCB_EIFSRVLOAD(e) (lcb_get_errtype(e) & LCB_ERRTYPE_SRVLOAD)
617 #define LCB_EIFSRVGEN(e) (lcb_get_errtype(e) & LCB_ERRTYPE_SRVGEN)
618 #define LCB_EIFSUBDOC(e) (lcb_get_errtype(e) & LCB_ERRTYPE_SUBDOC)
619 
626 LIBCOUCHBASE_API
628 
638 LIBCOUCHBASE_API
639 const char *lcb_strerror(lcb_t instance, lcb_error_t error);
640 
645 LCB_INTERNAL_API
646 const char *lcb_strerror_short(lcb_error_t error);
647 
651 LCB_INTERNAL_API
652 const char *lcb_strerror_long(lcb_error_t error);
653 
659 LIBCOUCHBASE_API
660 lcb_error_t lcb_errmap_default(lcb_t instance, lcb_U16 code);
661 
670 typedef lcb_error_t (*lcb_errmap_callback)(lcb_t instance, lcb_U16 bincode);
671 
673 LIBCOUCHBASE_API
675 
676 #ifdef __cplusplus
677 }
678 #endif
679 
680 #endif
const char * lcb_strerror(lcb_t instance, lcb_error_t error)
Get a textual descrtiption for the given error code
Error code indicates document (fulldoc) access ok, but error in performing subdocument operation...
Definition: error.h:85
lcb_errmap_callback lcb_set_errmap_callback(lcb_t, lcb_errmap_callback)
int lcb_get_errtype(lcb_error_t err)
Get error categories for a specific code
Error code indicating the server generated this message.
Definition: error.h:77
LCB_INTERNAL_API const char * lcb_strerror_short(lcb_error_t error)
Get a shorter textual description of an error message.
The errors below this value reserved for libcouchbase usage.
Definition: error.h:608
Error codes which should never be visible to the user.
Definition: error.h:68
lcb_errflags_t
Error Categories.
Definition: error.h:51
Error type indicating a fatal condition within the server or library.
Definition: error.h:59
Error type indicating a likely network failure.
Definition: error.h:56
Error code indicating the server is under load.
Definition: error.h:74
struct lcb_st * lcb_t
Library handle representing a connection to a cluster and its data buckets.
Definition: couchbase.h:41
lcb_error_t
Error codes returned by the library.
Definition: error.h:580
Error type indicating a transient condition within the server.
Definition: error.h:62
Error code indicating a plugin failure.
Definition: error.h:71
Error type indicating a likely issue in user input.
Definition: error.h:53
Error type indicating a negative server reply for the data.
Definition: error.h:65
LCB_INTERNAL_API const char * lcb_strerror_long(lcb_error_t error)
Get a longer textual description of an error message.
#define LCB_XERR(X)
XMacro for all error types.
Definition: error.h:103
lcb_error_t lcb_errmap_default(lcb_t instance, lcb_U16 code)
This may be used in conjunction with the errmap callback if it wishes to fallback for default behav...
lcb_error_t(* lcb_errmap_callback)(lcb_t instance, lcb_U16 bincode)
Callback for error mappings.
Definition: error.h:688