dodo
0.0.1
A C++ library to create containerized Linux services
|
Go to the documentation of this file.
23 #ifndef dodo_common_exception_hpp
24 #define dodo_common_exception_hpp
93 const std::string &
what );
103 const std::string &
what,
112 virtual const char*
what()
const noexcept;
150 const std::string &
what,
162 const std::string &
what,
174 #define throw_Exception( what ) throw dodo::common::Exception( __FILE__, __LINE__, dodo::common::Puts() << what )
181 #define throw_ExceptionObject( what, thing ) throw dodo::common::Exception( __FILE__, __LINE__, dodo::common::Puts() << what, thing )
188 #define throw_SystemException( what, errno ) throw dodo::common::SystemException( __FILE__, __LINE__, dodo::common::Puts() << what, errno )
196 #define throw_SystemExceptionObject( what, errno, thing ) throw dodo::common::SystemException( __FILE__, __LINE__, dodo::common::Puts() << what, errno, thing )
Descending from Exception, exceptions based on a dodo::common::SystemError code.
unsigned int line_
The source line number.
virtual ~DebugObject()
Destructor does nothing.
dodo::common::SystemError error_
The exception system error.
Interface to objects that support dumping their state to a string.
unsigned int getLine() const
Return the line number in the source file where the exception was thrown.
Exception(const std::string &file, unsigned int line, const std::string &what)
Construct an Exception.
const std::string & getFile() const
Return the source file where the exception was thrown.
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.
Linux system error primitive to provide a consistent interface to Linux error codes.
std::string msg_
The exception message.
DebugObject()
Default constructor does nothing.
An Exception is thrown in exceptional circumstances, and its occurrence should generally imply that t...