8using dittoffi_error_t = dittoffi_error;
10#define DEFINE_EXCEPTION_CLASS_WITH_DOCS(EXCEPTION_NAME, DOCSTRING, ...) \
14 class EXCEPTION_NAME : public std::exception { \
16 std::string message; \
20 const char *what() const noexcept override { return message.c_str(); } \
26#define DEFINE_EXCEPTION_CLASS(EXCEPTION_NAME, ...) \
27 class EXCEPTION_NAME : public std::exception { \
29 std::string message; \
33 const char *what() const noexcept override { return message.c_str(); } \
44class DittoError :
public std::exception {
49 explicit DittoError(dittoffi_error_t *ffi_error);
50 explicit DittoError(std::string msg);
57 char const *
what() const noexcept override;
64DEFINE_EXCEPTION_CLASS(AttachmentNotFoundError,
65 friend class AttachmentFetcherCtx;)
66DEFINE_EXCEPTION_CLASS(AttachmentTokenInvalidError,
67 friend class AttachmentFetcherCtx;)
68DEFINE_EXCEPTION_CLASS(FailedToFetchAttachmentError,
69 friend class AttachmentFetcherCtx;)
75DEFINE_EXCEPTION_CLASS(FailedToCreateAttachmentError, friend class Store;)
81DEFINE_EXCEPTION_CLASS_WITH_DOCS(
82 ValidationNotAMapError,
83 R
"(The object is not a map where a map is expected.)",
84 friend class Presence;)
85DEFINE_EXCEPTION_CLASS_WITH_DOCS(
86 ValidationSizeLimitExceededError,
87 R
"(The size limit for some piece of data has been exceeded.)",
88 friend class Presence;)
89DEFINE_EXCEPTION_CLASS_WITH_DOCS(
90 ValidationNotJSONCompatibleError,
91 R
"(The object is or contain(s) types that aren't JSON compatible.)",
92 friend class Presence;)
96DEFINE_EXCEPTION_CLASS_WITH_DOCS(
97 TransactionReadOnlyError,
98 R
"(A mutating DQL query was executed in a read-only transaction.)",
99 friend class Transaction;)
110 using DittoError::DittoError;
120 using DittoError::DittoError;
130 using DittoError::DittoError;
141 using DittoError::DittoError;
char const * what() const noexcept override
Returns the explanatory string.
Definition Errors.hpp:104
Definition Errors.hpp:114
Definition Errors.hpp:135
Definition Errors.hpp:124
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19