Loxahatchee  v0.0.1-1346
Lox Convenience C++ Library
Lox::Exception Class Reference

Exception class with an easy-to-use embedded backtrace. More...

#include <LoxException.hpp>

Inheritance diagram for Lox::Exception:
Collaboration diagram for Lox::Exception:

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...
 

Detailed Description

Exception class with an easy-to-use embedded backtrace.

Constructor & Destructor Documentation

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Lox::Exception::~Exception ( void  )
virtualnoexcept

Destructor.

Member Function Documentation

void Lox::Exception::display ( void  ) const
virtual

Display information on the content of the exception.

See also
operator std::string()
void Lox::Exception::initialize ( const std::string &  func,
const std::string &  file,
const int  line,
const std::string &  exceptionName,
const std::string &  what,
const std::string &  dbquery = "" 
)
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().

Here is the call graph for this function:

Here is the caller graph for this function:

Lox::Exception::operator std::string ( void  ) const
virtual

Produce a large block of text describing everything we know about the exception.

See also
display()

References Lox::demangle(), Lox::getBacktrace(), getErrnoString(), getWin32ErrorString(), Lox::name(), and Lox::trim().

Here is the call graph for this function:

virtual std::string Lox::Exception::to_string ( void  ) const
inlinevirtual

Alias to convert the exception into a block of text.

const char * Lox::Exception::what ( void  ) const
virtualnoexcept

Inherited from std::exception.

Member Data Documentation

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.

See also
WHERE
std::string Lox::Exception::functionName

Function name where the exception was created.

See also
WHERE
int Lox::Exception::lineNumber

Line number where the exception was created.

See also
WHERE
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).


The documentation for this class was generated from the following files: