Error Class Reference
Basic error class. More...
#include <error.hpp>
Inheritance diagram for Error:

Public Member Functions | |
Error () | |
Default constructor for error class. More... | |
Error (const std::string &str) | |
Constructor for error class with error message. More... | |
Error (const ErrorLocation &loc) | |
Constructor for error class with location information. More... | |
Error (const ErrorLocation &loc, const std::string &str) | |
Constructor for error class with location information and error message. More... | |
std::string | get_error_message (void) |
Return error message. More... | |
void | print_error_message (std::ostream &os, bool traceprint=true) |
Print a standard error message to os. More... | |
![]() | |
ExceptionTracer () | |
Default constructor for exception tracer. Saves the backtrace of the program at this location for printing it when the error is caught. More... | |
void | print_trace (std::ostream &os) |
Print the backtrace to os. More... | |
Protected Attributes | |
std::string | _error_str |
Detailed Description
Basic error class.
Constructor & Destructor Documentation
◆ Error() [1/4]
Error::Error | ( | ) |
Default constructor for error class.
◆ Error() [2/4]
Error::Error | ( | const std::string & | str | ) |
Constructor for error class with error message.
◆ Error() [3/4]
Error::Error | ( | const ErrorLocation & | loc | ) |
Constructor for error class with location information.
◆ Error() [4/4]
Error::Error | ( | const ErrorLocation & | loc, |
const std::string & | str | ||
) |
Constructor for error class with location information and error message.
Member Function Documentation
◆ get_error_message()
std::string Error::get_error_message | ( | void | ) |
Return error message.
◆ print_error_message()
void Error::print_error_message | ( | std::ostream & | os, |
bool | traceprint = true |
||
) |
Print a standard error message to os.
Print error message string and the error location is source code. Also prints the exception back trace if print_trace is true.
The documentation for this class was generated from the following files:
- error.hpp
- error.cpp