Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
#include <Exceptions.h>
Classes | |
struct | Location |
Traceback location. More... | |
Public Member Functions | |
Exception () | |
const std::list< Location > & | getTraceback () const |
const Exception & | log (log4cpp::Priority::Value level, Elements::Logging &logger) const |
Log error message and traceback. | |
void | restore () const |
Call PyErr_Restore and restore the error. This can be used when Pyston::Exception goes back to Python. | |
![]() | |
Exception (ExitCode e=ExitCode::NOT_OK) | |
Exception (const char *message, ExitCode e=ExitCode::NOT_OK) | |
Exception (const std::string &message, ExitCode e=ExitCode::NOT_OK) | |
Exception (const char *stringFormat, Args &&... args) | |
virtual | ~Exception () noexcept=default |
const char * | what () const noexcept override |
ExitCode | exitCode () const noexcept |
void | appendMessage (const T &message) |
![]() | |
T | what (T... args) |
T | ~exception (T... args) |
T | operator= (T... args) |
T | exception (T... args) |
Private Attributes | |
std::list< Location > | m_traceback |
boost::python::object | m_error_type |
boost::python::object | m_error_value |
boost::python::object | m_error_traceback |
Additional Inherited Members | |
![]() | |
std::string | m_error_msg |
const ExitCode | m_exit_code |
Exception class Used to wrap Python exceptions so the caller code can handle them transparently
Definition at line 33 of file Exceptions.h.
Pyston::Exception::Exception | ( | ) |
Constructor The error message is retrieved from the exception thrown inside Python
Definition at line 30 of file Exceptions.cpp.
References std::string::empty(), Pyston::Exception::Location::filename, Pyston::Exception::Location::funcname, Pyston::Exception::Location::lineno, Elements::Exception::m_error_msg, m_error_traceback, m_error_type, m_error_value, and m_traceback.
auto Pyston::Exception::getTraceback | ( | ) | const |
const Exception & Pyston::Exception::log | ( | log4cpp::Priority::Value | level, |
Elements::Logging & | logger | ||
) | const |
Log error message and traceback.
Definition at line 70 of file Exceptions.cpp.
References Elements::Logging::log(), logger, m_traceback, and std::stringstream::str().
void Pyston::Exception::restore | ( | ) | const |
Call PyErr_Restore and restore the error. This can be used when Pyston::Exception goes back to Python.
Definition at line 79 of file Exceptions.cpp.
References m_error_traceback, m_error_type, and m_error_value.
|
private |
Definition at line 66 of file Exceptions.h.
Referenced by Exception(), and restore().
|
private |
Definition at line 64 of file Exceptions.h.
Referenced by Exception(), and restore().
|
private |
Definition at line 65 of file Exceptions.h.
Referenced by Exception(), and restore().
Definition at line 63 of file Exceptions.h.
Referenced by Exception(), getTraceback(), and log().