|
The base class for exceptions supported by the Tf exceptions facilities. More...
#include <exception.h>
Public Member Functions | |
TF_API | TfBaseException (std::string const &message) |
Construct with message , reported by this class's what() implementation. | |
TfCallContext const & | GetThrowContext () const |
Return the call context from the throw point associated with this exception. | |
std::vector< uintptr_t > const & | GetThrowStack () const |
Return the stack frame pointers from the throw point. | |
void | MoveThrowStackTo (std::vector< uintptr_t > &out) |
Move the stack frame pointers from the throw point to out . | |
virtual TF_API const char * | what () const noexcept override |
Override std::exception::what() to return the message passed during construction. | |
The base class for exceptions supported by the Tf exceptions facilities.
Typical usage is to publically derive your own exception class from this one, and throw using the TF_THROW() macro.
Deriving this base class and throwing via TF_THROW() will record the throw point's call context (see GetThrowContext()) and will also capture a portion of the throwing thread's call stack (see GetThrowStack()).
Additionally, the Tf library registers an exception translator with boost.python to raise a Python exeption wrapping the thrown exception object. Similarly utilties that call Python via Tf will re-throw the embedded C++ exception if the Python exception unwinds back into C++.
Definition at line 63 of file exception.h.
|
explicit |
Construct with message
, reported by this class's what() implementation.
|
inline |
Return the call context from the throw point associated with this exception.
Note that this context may be invalid if this exception was not thrown with TF_THROW().
Definition at line 77 of file exception.h.
|
inline |
Return the stack frame pointers from the throw point.
See ArchPrintStackFrames() to turn these into human-readable strings.
Definition at line 83 of file exception.h.
|
inline |
Move the stack frame pointers from the throw point to out
.
See GetThrowStack() for more details.
Definition at line 89 of file exception.h.
|
overridevirtualnoexcept |
Override std::exception::what() to return the message passed during construction.