Alexandria  2.25.0
SDC-CH common library for the Euclid project
Classes | Public Member Functions | Private Attributes | List of all members
Pyston::Exception Class Reference

#include <Exceptions.h>

Inheritance diagram for Pyston::Exception:
Inheritance graph
[legend]
Collaboration diagram for Pyston::Exception:
Collaboration graph
[legend]

Classes

struct  Location
 Traceback location. More...
 

Public Member Functions

 Exception ()
 
const std::list< Location > & getTraceback () const
 
const Exceptionlog (log4cpp::Priority::Value level, Elements::Logging &logger) const
 Log error message and traceback. More...
 

Private Attributes

std::list< Locationm_traceback
 

Detailed Description

Exception class Used to wrap Python exceptions so the caller code can handle them transparently

Definition at line 32 of file Exceptions.h.

Constructor & Destructor Documentation

◆ Exception()

Pyston::Exception::Exception ( )

Constructor The error message is retrieved from the exception thrown inside Python

Note
If there is no error set on the Python side, a generic error will be used instead
The constructor will take care of calling PyErr_clear
Warning
The caller is assumed to own the global interlock!

Definition at line 30 of file Exceptions.cpp.

References Pyston::Exception::Location::filename, Pyston::Exception::Location::funcname, Pyston::Exception::Location::lineno, and m_traceback.

Member Function Documentation

◆ getTraceback()

auto Pyston::Exception::getTraceback ( ) const
Returns
Error traceback

Definition at line 68 of file Exceptions.cpp.

References m_traceback.

◆ log()

const Exception & Pyston::Exception::log ( log4cpp::Priority::Value  level,
Elements::Logging &  logger 
) const

Log error message and traceback.

Definition at line 72 of file Exceptions.cpp.

References logger, m_traceback, and std::stringstream::str().

Here is the call graph for this function:

Member Data Documentation

◆ m_traceback

std::list<Location> Pyston::Exception::m_traceback
private

Definition at line 59 of file Exceptions.h.

Referenced by Exception(), getTraceback(), and log().


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