Nameless Engine
|
#include <Error.h>
Public Member Functions | |
Error (std::string_view sMessage, const std::source_location location=std::source_location::current()) | |
Error (const Error &other)=default | |
Error & | operator= (const Error &other)=default |
Error (Error &&other)=default | |
Error & | operator= (Error &&other)=default |
void | addCurrentLocationToErrorStack (const std::source_location location=std::source_location::current()) |
std::string | getFullErrorMessage () const |
std::string | getInitialMessage () const |
void | showError () const |
Static Protected Member Functions | |
static SourceLocationInfo | sourceLocationToInfo (const std::source_location &location) |
Private Attributes | |
std::string | sMessage |
std::vector< SourceLocationInfo > | stack |
Helper class for storing and showing error messages.
ne::Error::Error | ( | std::string_view | sMessage, |
const std::source_location | location = std::source_location::current() |
||
) |
|
default |
Copy constructor.
other | other object. |
|
default |
Move constructor.
other | other object. |
void ne::Error::addCurrentLocationToErrorStack | ( | const std::source_location | location = std::source_location::current() | ) |
Adds the caller's file and line as a new entry to the error location stack.
location | Should not be specified explicitly (use default value). |
std::string ne::Error::getFullErrorMessage | ( | ) | const |
Creates an error string that contains an error message and an error location stack.
std::string ne::Error::getInitialMessage | ( | ) | const |
Returns initial error message that was used to create this error.
Copy assignment.
other | other object. |
Move assignment.
other | other object. |
void ne::Error::showError | ( | ) | const |
Creates an error string, shows it on screen and also writes it to log.
|
staticprotected |
Converts source_location instance to location information.
location | Source location instance. |
|
private |
Initial error message (string version).
|
private |
Error stack.