68 const char* what()
const noexcept override {
return "Invalid password."; }
81 const std::string msg_{};
82 std::optional<uint64_t> offset_{};
85 explicit FormatError(std::string msg) : msg_(std::move(msg)) {}
91 FormatError(std::string msg, uint64_t offset) : msg_(std::move(msg)), offset_(offset) {}
93 const char* what() const noexcept
override {
return msg_.c_str(); }
96 std::optional<uint64_t>
offset() const noexcept {
return offset_; }
134 const std::string msg_{};
137 explicit InternalError(std::string msg) : msg_(std::move(msg)) {}
139 const char* what()
const noexcept override {
return msg_.c_str(); }
149 const std::string msg_{};
152 explicit IoError(std::string msg) : msg_(std::move(msg)) {}
154 const char* what()
const noexcept override {
return msg_.c_str(); }
Common base class for all libkeepass exceptions.
Definition exception.hh:55
virtual ErrorCategory category() const noexcept=0
Returns the coarse category of this error.
Thrown when a requested file does not exist.
Definition exception.hh:162
Thrown for the same class of errors as asserts, but in release builds.
Definition exception.hh:132
ErrorCategory category() const noexcept override
Returns the coarse category of this error.
Definition exception.hh:141
Thrown for input/output errors while reading or writing databases.
Definition exception.hh:147
ErrorCategory category() const noexcept override
Returns the coarse category of this error.
Definition exception.hh:156
Thrown when an invalid password is supplied while opening a database.
Definition exception.hh:64
ErrorCategory category() const noexcept override
Returns the coarse category of this error.
Definition exception.hh:70
Thrown when a parser, decompressor or XML budget is exceeded.
Definition exception.hh:120
ErrorCategory category() const noexcept override
Returns the coarse category of this error.
Definition exception.hh:126
Thrown when a database uses a valid but unsupported format feature.
Definition exception.hh:108
ErrorCategory category() const noexcept override
Returns the coarse category of this error.
Definition exception.hh:114
LIBKEEPASS_API const char * ErrorCategoryName(ErrorCategory category) noexcept
Returns a stable, lowercase name for an error category.
ErrorCategory
Coarse error category shared by all library exceptions.
Definition exception.hh:40
@ kFormat
Corrupt, truncated or otherwise invalid database.
@ kResourceLimit
A parser/decompression resource budget was exceeded.
@ kUnsupported
A valid but unsupported format feature/version.
@ kInternal
An internal invariant or allocation failed.
@ kAuthentication
Wrong password, key file or key.
@ kIo
Reading or writing failed.
Visibility/export macro for the shared library.
#define LIBKEEPASS_API
Marks a class, function or variable as part of the public ABI.
Definition export.hh:43