dodo
0.0.1
A C++ library to create containerized Linux services
|
Go to the documentation of this file.
26 #if CMAKE_CXX_COMPILER_ID == GNU
42 #if CMAKE_CXX_COMPILER_ID == GNU
44 char * demangled = abi::__cxa_demangle(
typeid(*this).name(),0,0,&status);
45 ss << demangled <<
" ";
48 ss <<
typeid(*this).name() <<
" ";
51 ss <<
"address " << std::hex << (
void*)
this <<
" ";
56 std::runtime_error(what), file_(file), line_(line) {
63 std::runtime_error(what), file_(file), line_(line) {
70 Exception::~Exception() {
79 const std::string &what,
81 :
Exception( file, line, what +
" : " + error.asString() ) {
87 const std::string &what,
92 common::
Puts() << what <<
" : " << error.asString() << common::
Puts::endl() << thing->debugString() ) {
unsigned int line_
The source line number.
dodo::common::SystemError error_
The exception system error.
Interface to objects that support dumping their state to a string.
Exception(const std::string &file, unsigned int line, const std::string &what)
Construct an Exception.
virtual const char * what() const noexcept
Return the exception message.
std::string debugHeader() const
Generates a debug header (address of this object and a demangled class name.
std::string file_
The source file.
SystemException(const std::string &file, unsigned int line, const std::string &what, const dodo::common::SystemError &error)
Constructor.
Common and utility interfaces.
std::string debugString() const
Return the object dump to string.
virtual std::string debugDetail() const
Descendant classes can override to dump details specific to the class.
Helper class to write strings in stream format, eg.
Linux system error primitive to provide a consistent interface to Linux error codes.
std::string msg_
The exception message.
An Exception is thrown in exceptional circumstances, and its occurrence should generally imply that t...