Couchbase Lite C
Couchbase Lite C API
Data Structures | Enumerations | Functions
Errors

Types and constants for communicating errors from API calls. More...

Data Structures

struct  CBLError
 A struct holding information about an error. More...
 

Enumerations

enum  CBLErrorDomain : uint8_t {
  kCBLDomain = 1 , kCBLPOSIXDomain , kCBLSQLiteDomain , kCBLFleeceDomain ,
  kCBLNetworkDomain , kCBLWebSocketDomain
}
 Error domains, serving as namespaces for numeric error codes. More...
 
enum  CBLErrorCode : int32_t {
  kCBLErrorAssertionFailed = 1 , kCBLErrorUnimplemented , kCBLErrorUnsupportedEncryption , kCBLErrorBadRevisionID ,
  kCBLErrorCorruptRevisionData , kCBLErrorNotOpen , kCBLErrorNotFound , kCBLErrorConflict ,
  kCBLErrorInvalidParameter , kCBLErrorUnexpectedError , kCBLErrorCantOpenFile , kCBLErrorIOError ,
  kCBLErrorMemoryError , kCBLErrorNotWriteable , kCBLErrorCorruptData , kCBLErrorBusy ,
  kCBLErrorNotInTransaction , kCBLErrorTransactionNotClosed , kCBLErrorUnsupported , kCBLErrorNotADatabaseFile ,
  kCBLErrorWrongFormat , kCBLErrorCrypto , kCBLErrorInvalidQuery , kCBLErrorMissingIndex ,
  kCBLErrorInvalidQueryParam , kCBLErrorRemoteError , kCBLErrorDatabaseTooOld , kCBLErrorDatabaseTooNew ,
  kCBLErrorBadDocID , kCBLErrorCantUpgradeDatabase
}
 Couchbase Lite error codes, in the CBLDomain. More...
 
enum  CBLNetworkErrorCode : int32_t {
  kCBLNetErrDNSFailure = 1 , kCBLNetErrUnknownHost , kCBLNetErrTimeout , kCBLNetErrInvalidURL ,
  kCBLNetErrTooManyRedirects , kCBLNetErrTLSHandshakeFailed , kCBLNetErrTLSCertExpired , kCBLNetErrTLSCertUntrusted ,
  kCBLNetErrTLSClientCertRequired , kCBLNetErrTLSClientCertRejected , kCBLNetErrTLSCertUnknownRoot , kCBLNetErrInvalidRedirect ,
  kCBLNetErrUnknown , kCBLNetErrTLSCertRevoked , kCBLNetErrTLSCertNameMismatch
}
 Network error codes, in the CBLNetworkDomain. More...
 

Functions

FLSliceResult CBLError_Message (const CBLError *_cbl_nullable outError)
 Returns a message describing an error. More...
 

Detailed Description

Types and constants for communicating errors from API calls.

Enumeration Type Documentation

◆ CBLErrorCode

enum CBLErrorCode : int32_t

Couchbase Lite error codes, in the CBLDomain.

Enumerator
kCBLErrorAssertionFailed 

Internal assertion failure.

kCBLErrorUnimplemented 

Oops, an unimplemented API call.

kCBLErrorUnsupportedEncryption 

Unsupported encryption algorithm.

kCBLErrorBadRevisionID 

Invalid revision ID syntax.

kCBLErrorCorruptRevisionData 

Revision contains corrupted/unreadable data.

kCBLErrorNotOpen 

Database/KeyStore/index is not open.

kCBLErrorNotFound 

Document not found.

kCBLErrorConflict 

Document update conflict.

kCBLErrorInvalidParameter 

Invalid function parameter or struct value.

kCBLErrorUnexpectedError 
kCBLErrorCantOpenFile 

Internal unexpected C++ exception.

Database file can't be opened; may not exist

kCBLErrorIOError 

File I/O error.

kCBLErrorMemoryError 

Memory allocation failed (out of memory?)

kCBLErrorNotWriteable 

File is not writeable.

kCBLErrorCorruptData 

Data is corrupted.

kCBLErrorBusy 

Database is busy/locked.

kCBLErrorNotInTransaction 

Function must be called while in a transaction.

kCBLErrorTransactionNotClosed 

Database can't be closed while a transaction is open.

kCBLErrorUnsupported 

Operation not supported in this database.

kCBLErrorNotADatabaseFile 
kCBLErrorWrongFormat 

File is not a database, or encryption key is wrong.

Database exists but not in the format/storage requested

kCBLErrorCrypto 

Encryption/decryption error.

kCBLErrorInvalidQuery 

Invalid query.

kCBLErrorMissingIndex 

No such index, or query requires a nonexistent index.

kCBLErrorInvalidQueryParam 

Unknown query param name, or param number out of range.

kCBLErrorRemoteError 

Unknown error from remote server.

kCBLErrorDatabaseTooOld 

Database file format is older than what I can open.

kCBLErrorDatabaseTooNew 

Database file format is newer than what I can open.

kCBLErrorBadDocID 

Invalid document ID.

kCBLErrorCantUpgradeDatabase 

◆ CBLErrorDomain

enum CBLErrorDomain : uint8_t

Error domains, serving as namespaces for numeric error codes.

Enumerator
kCBLDomain 

code is a Couchbase Lite error code; see CBLErrorCode

kCBLPOSIXDomain 

code is a POSIX errno; see "errno.h"

kCBLSQLiteDomain 

code is a SQLite error; see "sqlite3.h"

kCBLFleeceDomain 

code is a Fleece error; see "FleeceException.h"

kCBLNetworkDomain 

code is a network error; see CBLNetworkErrorCode

kCBLWebSocketDomain 

code is a WebSocket close code (1000...1015) or HTTP error (300..599)

◆ CBLNetworkErrorCode

enum CBLNetworkErrorCode : int32_t

Network error codes, in the CBLNetworkDomain.

Enumerator
kCBLNetErrDNSFailure 

DNS lookup failed.

kCBLNetErrUnknownHost 

DNS server doesn't know the hostname.

kCBLNetErrTimeout 

No response received before timeout.

kCBLNetErrInvalidURL 

Invalid URL.

kCBLNetErrTooManyRedirects 

HTTP redirect loop.

kCBLNetErrTLSHandshakeFailed 

Low-level error establishing TLS.

kCBLNetErrTLSCertExpired 

Server's TLS certificate has expired.

kCBLNetErrTLSCertUntrusted 

Cert isn't trusted for other reason.

kCBLNetErrTLSClientCertRequired 

Server requires client to have a TLS certificate.

kCBLNetErrTLSClientCertRejected 

Server rejected my TLS client certificate.

kCBLNetErrTLSCertUnknownRoot 

Self-signed cert, or unknown anchor cert.

kCBLNetErrInvalidRedirect 

Attempted redirect to invalid URL.

kCBLNetErrUnknown 

Unknown networking error.

kCBLNetErrTLSCertRevoked 

Server's cert has been revoked.

kCBLNetErrTLSCertNameMismatch 

Server cert's name does not match DNS name.

Function Documentation

◆ CBLError_Message()

FLSliceResult CBLError_Message ( const CBLError *_cbl_nullable  outError)

Returns a message describing an error.

Note
You are responsible for releasing the result by calling FLSliceResult_Release.