Exception class with an easy-to-use embedded backtrace. More...
#include <LoxException.hpp>
Public Member Functions | |
Exception (const std::string &func, const std::string &file, const int line, const std::string &what, const std::string &dbquery="") | |
Constructor. More... | |
Exception (const std::string &func, const std::string &file, const int line, const std::exception &e) | |
Upgrade one of the standard std::exceptions to something with more details. More... | |
Exception (const std::string &func, const std::string &file, const int line, const pqxx::pqxx_exception &e) | |
Upgrade one of the pqxx exceptions to something with more details. More... | |
virtual | ~Exception (void) noexcept |
Destructor. More... | |
virtual void | display (void) const |
Display information on the content of the exception. More... | |
virtual | operator std::string (void) const |
Produce a large block of text describing everything we know about the exception. More... | |
virtual std::string | to_string (void) const |
Alias to convert the exception into a block of text. More... | |
virtual const char * | what (void) const noexcept |
Inherited from std::exception. More... | |
Public Attributes | |
VStr | bt |
The backtrace where the exception was created. More... | |
int | errorNumber |
errno when the exception was created. More... | |
std::string | filename |
Filename where the exception was created. More... | |
std::string | functionName |
Function name where the exception was created. More... | |
int | lineNumber |
Line number where the exception was created. More... | |
std::string | name |
The dynamic class name for the original exception object. More... | |
int | otherErrorNumber |
bool | shouldDisplay |
If the exception has already been displayed (or should not be displayed) then this flag can be toggled. More... | |
std::string | sql |
The SQL query that caused the exception. More... | |
std::string | text |
The text string returned by what(). More... | |
std::string | threadName |
Name of the current thread (according to JUCE). More... | |
Protected Member Functions | |
virtual void | initialize (const std::string &func, const std::string &file, const int line, const std::string &exceptionName, const std::string &what, const std::string &dbquery="") |
Since VisualStudio doesn't support delegating constructors, we need a centralized initialization method. More... | |
Exception class with an easy-to-use embedded backtrace.
Lox::Exception::Exception | ( | const std::string & | func, |
const std::string & | file, | ||
const int | line, | ||
const std::string & | what, | ||
const std::string & | dbquery = "" |
||
) |
Constructor.
References Lox::demangle(), initialize(), and LOX_WHEREPASS.
Lox::Exception::Exception | ( | const std::string & | func, |
const std::string & | file, | ||
const int | line, | ||
const std::exception & | e | ||
) |
Upgrade one of the standard std::exceptions to something with more details.
References Lox::demangle(), initialize(), LOX_WHEREPASS, and Lox::name().
Lox::Exception::Exception | ( | const std::string & | func, |
const std::string & | file, | ||
const int | line, | ||
const pqxx::pqxx_exception & | e | ||
) |
Upgrade one of the pqxx exceptions to something with more details.
References Lox::demangle(), initialize(), LOX_WHEREPASS, and Lox::name().
|
virtualnoexcept |
Destructor.
|
virtual |
Display information on the content of the exception.
|
protectedvirtual |
Since VisualStudio doesn't support delegating constructors, we need a centralized initialization method.
References Lox::Log::critical(), Lox::evenWhitespace(), Lox::getBacktrace(), Lox::name(), and Lox::trim().
Referenced by Exception().
|
virtual |
Produce a large block of text describing everything we know about the exception.
References Lox::demangle(), Lox::getBacktrace(), getErrnoString(), getWin32ErrorString(), Lox::name(), and Lox::trim().
|
inlinevirtual |
Alias to convert the exception into a block of text.
|
virtualnoexcept |
Inherited from std::exception.
VStr Lox::Exception::bt |
The backtrace where the exception was created.
int Lox::Exception::errorNumber |
errno when the exception was created.
std::string Lox::Exception::filename |
Filename where the exception was created.
std::string Lox::Exception::functionName |
Function name where the exception was created.
int Lox::Exception::lineNumber |
Line number where the exception was created.
std::string Lox::Exception::name |
The dynamic class name for the original exception object.
int Lox::Exception::otherErrorNumber |
bool Lox::Exception::shouldDisplay |
If the exception has already been displayed (or should not be displayed) then this flag can be toggled.
By default, this flag is set to true
when exceptions are first created.
std::string Lox::Exception::sql |
The SQL query that caused the exception.
std::string Lox::Exception::text |
The text string returned by what().
std::string Lox::Exception::threadName |
Name of the current thread (according to JUCE).