Bitcoin ABC 0.26.3
P2P Digital Currency
|
Go to the source code of this file.
Classes | |
class | NonFatalCheckError |
Macros | |
#define | format_internal_error(msg, file, line, func, report) |
#define | CHECK_NONFATAL(condition) inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition) |
Identity function. | |
#define | Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val) |
Identity function. | |
#define | Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val) |
Assume is the identity function. | |
#define | NONFATAL_UNREACHABLE() |
NONFATAL_UNREACHABLE() is a macro that is used to mark unreachable code. | |
Functions | |
template<typename T > | |
T && | inline_check_non_fatal (LIFETIMEBOUND T &&val, const char *file, int line, const char *func, const char *assertion) |
Helper for CHECK_NONFATAL() | |
void | assertion_fail (const char *file, int line, const char *func, const char *assertion) |
Helper for Assert() | |
template<bool IS_ASSERT, typename T > | |
T && | inline_assertion_check (LIFETIMEBOUND T &&val, const char *file, int line, const char *func, const char *assertion) |
Helper for Assert()/Assume() | |
Assume is the identity function.
#define CHECK_NONFATAL | ( | condition | ) | inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition) |
Identity function.
Throw a NonFatalCheckError when the condition evaluates to false
This should only be used
For example in RPC code, where it is undesirable to crash the whole program, this can be generally used to replace asserts or recoverable logic errors. A NonFatalCheckError in RPC code is caught and passed as a string to the RPC caller, which can then report the issue to the developers.
#define NONFATAL_UNREACHABLE | ( | ) |
NONFATAL_UNREACHABLE() is a macro that is used to mark unreachable code.
It throws a NonFatalCheckError. This is used to mark code that is not yet implemented or is not yet reachable.
T && inline_assertion_check | ( | LIFETIMEBOUND T && | val, |
const char * | file, | ||
int | line, | ||
const char * | func, | ||
const char * | assertion | ||
) |
T && inline_check_non_fatal | ( | LIFETIMEBOUND T && | val, |
const char * | file, | ||
int | line, | ||
const char * | func, | ||
const char * | assertion | ||
) |
Helper for CHECK_NONFATAL()
Definition at line 28 of file check.h.