8typedef dittoffi_error dittoffi_error_t;
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 DittoError(dittoffi_error_t *ffi_error);
50 explicit DittoError(std::string msg);
57 const char *
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;)
73DEFINE_EXCEPTION_CLASS(AttachmentFilePermissionDeniedError, friend class Store;)
74DEFINE_EXCEPTION_CLASS(AttachmentFileNotFoundError, friend class Store;)
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;)
const char * what() const noexcept override
Returns the explanatory string.
Definition Errors.cpp:40