xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
libxrpl
basics
libxrpl/basics/contract.cpp
1
#include <xrpl/basics/contract.h>
2
3
#include <xrpl/basics/Log.h>
4
#include <xrpl/beast/utility/instrumentation.h>
5
6
#include <
cstdlib
>
7
#include <
iostream
>
8
#include <
string
>
9
10
namespace
xrpl
{
11
12
void
13
logThrow
(
std::string
const
& title)
14
{
15
JLOG(
debugLog
().warn()) << title;
16
}
17
18
[[noreturn]]
void
19
logicError
(
std::string
const
& s)
noexcept
20
{
21
// LCOV_EXCL_START
22
JLOG(
debugLog
().fatal()) << s;
23
std::cerr
<<
"Logic error: "
<< s <<
std::endl
;
24
// Use a non-standard contract naming here (without namespace) because
25
// it's the only location where various unrelated execution paths may
26
// register an error; this is also why the "message" parameter is passed
27
// here.
28
// For the above reasons, we want this contract to stand out.
29
UNREACHABLE(
"LogicError"
, {{
"message"
, s}});
30
std::abort
();
31
// LCOV_EXCL_STOP
32
}
33
34
}
// namespace xrpl
std::abort
T abort(T... args)
std::string
std::cerr
cstdlib
std::endl
T endl(T... args)
iostream
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::debugLog
beast::Journal debugLog()
Returns a debug journal.
Definition
Log.cpp:399
xrpl::logicError
void logicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
Definition
libxrpl/basics/contract.cpp:19
xrpl::logThrow
void logThrow(std::string const &title)
Generates and logs a call stack.
Definition
libxrpl/basics/contract.cpp:13
string
Generated by
1.17.0