UtilsLite
Utilities for C++ programming
Loading...
Searching...
No Matches
Utils::Runtime_TraceError Class Reference

A custom exception class that captures and stores a backtrace on error. More...

#include <Utils_trace.hh>

Inheritance diagram for Utils::Runtime_TraceError:

Public Member Functions

 Runtime_TraceError (string_view reason, string_view file, int line)
 Constructs a Runtime_TraceError with a backtrace.
 
char const * what () const noexcept override
 

Detailed Description

A custom exception class that captures and stores a backtrace on error.

Runtime_TraceError is a subclass of std::runtime_error that captures the backtrace information (file, line, and reason) when an error occurs, making it easier to debug.

The exception message includes the backtrace details, which can be accessed via the what() method.

Constructor & Destructor Documentation

◆ Runtime_TraceError()

Utils::Runtime_TraceError::Runtime_TraceError ( string_view reason,
string_view file,
int line )
inlineexplicit

Constructs a Runtime_TraceError with a backtrace.

This constructor initializes the exception with a backtrace that includes the error reason, the file name, and the line number where the error occurred.

Parameters
reasonA description of the error or exception reason.
fileThe name of the source file where the error occurred.
lineThe line number where the error occurred.

Member Function Documentation

◆ what()

char const * Utils::Runtime_TraceError::what ( ) const
overridenoexcept

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