Couchbase Lite C++
Couchbase Lite C++ API
Loading...
Searching...
No Matches
cbl::Error Struct Reference

The exception thrown by the Couchbase Lite C++ API to report a Couchbase Lite failure. More...

#include <cbl++/Base.hh>

Inheritance diagram for cbl::Error:

Public Member Functions

 Error (CBLErrorDomain domain, int code, const std::string &what)
 Constructs an Error.
 Error ()
Erroroperator= (const Error &other)

Public Attributes

CBLErrorDomain domain
 Domain of errors.
int code
 Error code, specific to the domain. 0 always means no error.

Detailed Description

The exception thrown by the Couchbase Lite C++ API to report a Couchbase Lite failure.

It derives from std::runtime_error (and thus std::exception) and carries the failure's domain and code (the same values as the C API's CBLError), plus a human-readable message available via what(). Catch this type when you need the structured error information; catch std::exception for general handling.

Constructor & Destructor Documentation

◆ Error() [1/2]

cbl::Error::Error ( CBLErrorDomain domain,
int code,
const std::string & what )
inline

Constructs an Error.

Parameters
domainThe error domain.
codeThe error code, specific to the domain.
whatThe human-readable error message (returned by what()).

◆ Error() [2/2]

cbl::Error::Error ( )
inline

Member Function Documentation

◆ operator=()

Error & cbl::Error::operator= ( const Error & other)
inline

Member Data Documentation

◆ code

int cbl::Error::code

Error code, specific to the domain. 0 always means no error.

◆ domain

CBLErrorDomain cbl::Error::domain

Domain of errors.


The documentation for this struct was generated from the following file: