Loxahatchee  v0.0.1-1346
Lox Convenience C++ Library
LoxException.hpp File Reference

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

#include <string>
#include <exception>
#include "LoxTypes.hpp"
#include "LoxDBTypes.hpp"
Include dependency graph for LoxException.hpp:
This graph shows which files directly or indirectly include this file:

Classes

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

Namespaces

 Lox
 Common methods and functionality easily shared between projects.
 

Macros

#define LOX_CATCH_DISPLAY_AND_RETRHOW
 Standard exception handling for all exception types we expect to encounter. More...
 
#define LOX_WHERE   __PRETTY_FUNCTION__, __FILE__, __LINE__
 
#define LOX_WHERECLAUSE   const std::string &func, const std::string &file, const int line
 
#define LOX_WHEREPASS   func, file, line
 
#define LOX_WHEREUNKNOWN   "", "", 0
 

Functions

std::string Lox::demangle (std::string name)
 Demangle the given C++ name. More...
 
VStr Lox::getBacktrace (int skip=2)
 Store the backtrace in a string array. More...
 
std::ostream & operator<< (std::ostream &os, const Lox::Exception &e)
 Easily stream exception objects to std::cout or other similar streams. More...
 

Detailed Description

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

Macro Definition Documentation

#define LOX_CATCH_DISPLAY_AND_RETRHOW
Value:
catch ( const pqxx::pqxx_exception &e ) \
{ \
Lox::Exception ex( LOX_WHERE, e ); \
ex.display(); \
ex.shouldDisplay = false; \
throw ex; \
} \
catch ( Lox::Exception &e ) \
{ \
if ( e.shouldDisplay == true ) \
{ \
e.display(); \
e.shouldDisplay = false; \
} \
throw e; \
} \
catch ( const std::exception &e ) \
{ \
Lox::Exception ex( LOX_WHERE, e.what() ); \
ex.display(); \
ex.shouldDisplay = false; \
throw ex; \
}
#define LOX_WHERE
Definition: LoxException.hpp:31
Exception class with an easy-to-use embedded backtrace.
Definition: LoxException.hpp:22

Standard exception handling for all exception types we expect to encounter.

Referenced by Lox::PQDB::exec().

#define LOX_WHERE   __PRETTY_FUNCTION__, __FILE__, __LINE__
#define LOX_WHERECLAUSE   const std::string &func, const std::string &file, const int line
#define LOX_WHEREPASS   func, file, line
#define LOX_WHEREUNKNOWN   "", "", 0

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Lox::Exception e 
)
inline

Easily stream exception objects to std::cout or other similar streams.