9#ifdef __PRETTY_FUNCTION__
10#define NOT_IMPLEMENTED_YET() throw ots::exception::NotImplementedYet(__PRETTY_FUNCTION__)
12#define NOT_IMPLEMENTED_YET() throw ots::exception::NotImplementedYet(__func__)
15#define REGISTER_EXCEPTION(CLASS, CODE, NAME) \
16 static constexpr int32_t error_code = CODE; \
17 static constexpr const char* error_class = NAME; \
19 static inline bool registered = ots::exception::Exception::registerException<CLASS>(error_code, error_class);
46 const std::type_info&
type;
49 static std::vector<RegisteredException>&
registry() {
50 static std::vector<RegisteredException> instances;
57 registry().push_back({code, cls,
typeid(T)});
63 virtual const char*
what() const noexcept = 0;
75 inline explicit RuntimeError(
const std::string& msg): std::runtime_error(msg) {};
76 const char*
what() const noexcept
override {
return std::runtime_error::what(); }
88 inline explicit LogicError(
const std::string& msg): std::logic_error(msg) {};
89 const char*
what() const noexcept
override {
return std::logic_error::what(); }
101 inline explicit InvalidArgument(
const std::string& msg): std::invalid_argument(msg) {};
102 const char*
what() const noexcept
override {
return std::invalid_argument::what(); }
113 inline explicit RangeError(
const std::string& msg): std::range_error(msg) {};
114 const char*
what() const noexcept
override {
return std::range_error::what(); }
125 inline explicit NotImplementedYet(
const std::string& msg): std::logic_error(std::string(
"Not implemented yet: ") + msg) {};
126 const char*
what() const noexcept
override {
return std::logic_error::what(); }
137 inline explicit DomainError(
const std::string& msg): std::domain_error(msg) {};
138 const char*
what() const noexcept
override {
return std::domain_error::what(); }
150 inline explicit OutOfRange(
const std::string& msg): std::out_of_range(msg) {};
151 const char*
what() const noexcept
override {
return std::out_of_range::what(); }
220 namespace wipeablestring {
238 namespace wipeablevector {
486 namespace legacyseed {
490 inline explicit InvalidSeedFormat():
ots::exception::seed::SeedDecodingFailed(
"Invalid format of provided seed phrase") {};
size is bigger then buffer
Definition ots-exceptions.hpp:158
BufferOverflowException(const std::string &msg)
Definition ots-exceptions.hpp:162
BufferOverflowException()
Definition ots-exceptions.hpp:161
errors related to the library use itself
Definition ots-exceptions.hpp:134
const char * what() const noexcept override
Definition ots-exceptions.hpp:138
DomainError(const std::string &msg)
Definition ots-exceptions.hpp:137
Definition ots-exceptions.hpp:41
static bool registerException(int32_t code, const char *cls)
Definition ots-exceptions.hpp:56
virtual const char * what() const noexcept=0
static std::vector< RegisteredException > & registry()
Definition ots-exceptions.hpp:49
virtual ~Exception()=default
provided an invalid argument
Definition ots-exceptions.hpp:98
const char * what() const noexcept override
Definition ots-exceptions.hpp:102
InvalidArgument(const std::string &msg)
Definition ots-exceptions.hpp:101
violation of logical preconditions or class invariants
Definition ots-exceptions.hpp:85
const char * what() const noexcept override
Definition ots-exceptions.hpp:89
LogicError(const std::string &msg)
Definition ots-exceptions.hpp:88
Low entropy detected.
Definition ots-exceptions.hpp:199
LowEntropy()
Definition ots-exceptions.hpp:202
Could not allocate memory.
Definition ots-exceptions.hpp:169
MemoryAllocationError()
Definition ots-exceptions.hpp:172
Sole purpose of this exception is to create already the stub and mark as incomplete,...
Definition ots-exceptions.hpp:121
NotImplementedYet()
Definition ots-exceptions.hpp:124
NotImplementedYet(const std::string &msg)
Definition ots-exceptions.hpp:125
const char * what() const noexcept override
Definition ots-exceptions.hpp:126
arguments outside of expected range. Needle not in Haystack ;)
Definition ots-exceptions.hpp:147
OutOfRange(const std::string &msg)
Definition ots-exceptions.hpp:150
const char * what() const noexcept override
Definition ots-exceptions.hpp:151
range error in internal computation
Definition ots-exceptions.hpp:110
const char * what() const noexcept override
Definition ots-exceptions.hpp:114
RangeError(const std::string &msg)
Definition ots-exceptions.hpp:113
Conditions only detectable at runtime.
Definition ots-exceptions.hpp:72
RuntimeError(const std::string &msg)
Definition ots-exceptions.hpp:75
const char * what() const noexcept override
Definition ots-exceptions.hpp:76
Any security realted error: like no random generator available.
Definition ots-exceptions.hpp:189
SecurityError(const std::string &msg)
Definition ots-exceptions.hpp:192
Any security realted issue.
Definition ots-exceptions.hpp:179
SecurityException(const std::string &msg)
Definition ots-exceptions.hpp:182
a network is not known
Definition ots-exceptions.hpp:209
UnknownNetwork()
Definition ots-exceptions.hpp:212
account generation failed
Definition ots-exceptions.hpp:660
GenerationFailed()
Definition ots-exceptions.hpp:663
The provided string is not a valid Monero address.
Definition ots-exceptions.hpp:697
Invalid()
Definition ots-exceptions.hpp:700
The provided string is not an integrated address.
Definition ots-exceptions.hpp:707
NotIntegrated()
Definition ots-exceptions.hpp:710
a process tried to access locked key data
Definition ots-exceptions.hpp:522
LockedAccessAttempt(const std::string &msg)
Definition ots-exceptions.hpp:526
LockedAccessAttempt()
Definition ots-exceptions.hpp:525
a process tried to write to locked key data
Definition ots-exceptions.hpp:533
LockedWriteAttempt()
Definition ots-exceptions.hpp:536
a process tried to start a new session during an active session ongoing
Definition ots-exceptions.hpp:549
ActivePolyseedDataSession()
Definition ots-exceptions.hpp:552
no active session ongoing which could be commited or discarded
Definition ots-exceptions.hpp:559
NoActivePolyseedDataSession()
Definition ots-exceptions.hpp:562
write attempt while read only session
Definition ots-exceptions.hpp:569
PolyseedDataReadOnlySession()
Definition ots-exceptions.hpp:572
Seed phrase language is ambigous. Language must be explicit specified.
Definition ots-exceptions.hpp:464
AmbigousLanguage()
Definition ots-exceptions.hpp:467
a checksum mismatch detected
Definition ots-exceptions.hpp:426
ChecksumMismatch()
Definition ots-exceptions.hpp:429
Could not allocate memory.
Definition ots-exceptions.hpp:456
Seed encrypted, but no password provided.
Definition ots-exceptions.hpp:474
NoPasswordProvided()
Definition ots-exceptions.hpp:477
a feature is not supported by polyseed
Definition ots-exceptions.hpp:436
UnsupportedFeatures()
Definition ots-exceptions.hpp:439
a language is not supported by polyseed
Definition ots-exceptions.hpp:416
UnsupportedLanguage()
Definition ots-exceptions.hpp:419
a polyseed expected has a different word count. Polyseed are 16 words
Definition ots-exceptions.hpp:408
a language expected if not found
Definition ots-exceptions.hpp:307
LanguageNotFound()
Definition ots-exceptions.hpp:310
LanguageNotFound(const std::string &msg)
Definition ots-exceptions.hpp:311
a language is not supported by the seed type
Definition ots-exceptions.hpp:318
LanguageNotSupportedBySeedType()
Definition ots-exceptions.hpp:321
a seed expected has a different length, and is used instead of WordCount on merging Values/seed phras...
Definition ots-exceptions.hpp:361
LengthMismatch()
Definition ots-exceptions.hpp:364
a seed index could not be merged
Definition ots-exceptions.hpp:391
MergeError(const std::string &msg)
Definition ots-exceptions.hpp:394
a default language is expected but not set
Definition ots-exceptions.hpp:297
NoDefaultLanguageSet()
Definition ots-exceptions.hpp:300
a password is not supported for the seed type
Definition ots-exceptions.hpp:381
PasswordNotSupported()
Definition ots-exceptions.hpp:384
a seed could not be encoded
Definition ots-exceptions.hpp:349
SeedDecodingFailed(const std::string &msg)
Definition ots-exceptions.hpp:353
SeedDecodingFailed()
Definition ots-exceptions.hpp:352
a seed could not be encoded
Definition ots-exceptions.hpp:338
SeedEncodingFailed()
Definition ots-exceptions.hpp:341
SeedEncodingFailed(const std::string &msg)
Definition ots-exceptions.hpp:342
you need at least two values to merge.
Definition ots-exceptions.hpp:371
TooFewValues()
Definition ots-exceptions.hpp:374
a seed expected has a different word count. Polyseed are 16 words, Monero Seeds are 25 words,...
Definition ots-exceptions.hpp:328
WordCount()
Definition ots-exceptions.hpp:331
a seed expected if not found
Definition ots-exceptions.hpp:505
SeedNotFound()
Definition ots-exceptions.hpp:508
a message is empty
Definition ots-exceptions.hpp:270
EmptyMessage()
Definition ots-exceptions.hpp:273
a signature is empty
Definition ots-exceptions.hpp:280
EmptySignature()
Definition ots-exceptions.hpp:283
a signature is invalid
Definition ots-exceptions.hpp:259
InvalidSignature(const std::string &msg)
Definition ots-exceptions.hpp:263
InvalidSignature()
Definition ots-exceptions.hpp:262
the provided unsigned transaction is not valid
Definition ots-exceptions.hpp:678
Invalid(const std::string &msg)
Definition ots-exceptions.hpp:682
Invalid()
Definition ots-exceptions.hpp:681
wallet does not contain the provided address
Definition ots-exceptions.hpp:588
AddressNotFound()
Definition ots-exceptions.hpp:591
the provided ciphertext is not valid
Definition ots-exceptions.hpp:631
CiphertextAuthenticationFailed()
Definition ots-exceptions.hpp:634
CiphertextAuthenticationFailed(const std::string &msg)
Definition ots-exceptions.hpp:635
export key images failed
Definition ots-exceptions.hpp:609
ExportKeyImages()
Definition ots-exceptions.hpp:612
ExportKeyImages(const std::string &msg)
Definition ots-exceptions.hpp:613
Import outputs failed.
Definition ots-exceptions.hpp:598
ImportOutputs()
Definition ots-exceptions.hpp:601
ImportOutputs(const std::string &msg)
Definition ots-exceptions.hpp:602
an internal error occurred (monero specific)
Definition ots-exceptions.hpp:642
InternalError(const std::string &msg)
Definition ots-exceptions.hpp:646
InternalError()
Definition ots-exceptions.hpp:645
the provided ciphertext is not valid
Definition ots-exceptions.hpp:620
InvalidCiphertext()
Definition ots-exceptions.hpp:623
InvalidCiphertext(const std::string &msg)
Definition ots-exceptions.hpp:624
a conversion to std::string is not allowed
Definition ots-exceptions.hpp:226
UnsafeConversion()
Definition ots-exceptions.hpp:229
a conversion to std::vector is not allowed
Definition ots-exceptions.hpp:242
UnsafeConversion()
Definition ots-exceptions.hpp:245
The library exists complete only in this namespace.
Definition account.hpp:39
#define REGISTER_EXCEPTION(CLASS, CODE, NAME)
Definition ots-exceptions.hpp:15
Definition ots-exceptions.hpp:43
const std::type_info & type
Definition ots-exceptions.hpp:46
int32_t error_code
Definition ots-exceptions.hpp:44
const char * error_class
Definition ots-exceptions.hpp:45