mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Improve exception handling:
* Self-document the code by renaming Throw to Rethrow. * Write a message to the debug log when we throw or rethrow an exception.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <BeastConfig.h>
|
||||
#include <ripple/basics/contract.h>
|
||||
#include <ripple/basics/Log.h>
|
||||
#include <cstdlib>
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
@@ -39,10 +40,17 @@ accessViolation() noexcept
|
||||
|
||||
} // detail
|
||||
|
||||
void
|
||||
LogThrow (std::string const& title)
|
||||
{
|
||||
JLOG(debugLog()) << title;
|
||||
}
|
||||
|
||||
[[noreturn]]
|
||||
void
|
||||
LogicError (std::string const& s) noexcept
|
||||
{
|
||||
JLOG(debugLog()) << s;
|
||||
std::cerr << "Logic error: " << s << std::endl;
|
||||
detail::accessViolation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user