Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::TracedRuntimeError Class Reference

A runtime error carrying the stack trace of where it was thrown. More...

#include <assert.h>

Inheritance diagram for sen::TracedRuntimeError:

Public Member Functions

 TracedRuntimeError (const std::string &err)
std::string getTrace (bool color=false) const
 The throw site's trace, symbolised on each call.

Detailed Description

A runtime error carrying the stack trace of where it was thrown.

It derives from std::runtime_error alone, so it has a single std::exception base and every handler for either of those matches it. cpptrace's own error types reach std::exception by a separate path, which is why the trace is held rather than inherited.

The trace is held behind an opaque pointer and read as text, because this header is included almost everywhere and naming a cpptrace type here would put that library on every consumer's include path.

Constructor & Destructor Documentation

◆ TracedRuntimeError()

sen::TracedRuntimeError::TracedRuntimeError ( const std::string & err)
explicit

Member Function Documentation

◆ getTrace()

std::string sen::TracedRuntimeError::getTrace ( bool color = false) const
nodiscard

The throw site's trace, symbolised on each call.


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