matf-rg-engine 1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
engine::util::Error Class Reference

Base class for all errors. More...

#include <Errors.hpp>

Inheritance diagram for engine::util::Error:
Inheritance graph
[legend]
Collaboration diagram for engine::util::Error:
Collaboration graph
[legend]

Public Member Functions

 Error (std::string message, std::source_location location=std::source_location::current())
 Construct an Error.
 
const std::string & message () const
 Get the error message.
 
std::source_location location () const
 Get the location of the error.
 
virtual std::string report () const
 Get the error report. You can override this method in derived classes to provide a more detailed error report.
 

Private Attributes

std::string m_message
 
std::source_location m_location
 

Detailed Description

Base class for all errors.

Exceptions are not meant to be caught. They are meant to be used as a graceful way to stop the program and give a meaningful instruction to the user on how to fix the problem.

Constructor & Destructor Documentation

◆ Error()

engine::util::Error::Error ( std::string  message,
std::source_location  location = std::source_location::current() 
)
inlineexplicit

Construct an Error.

Parameters
messageThe error message.
locationThe location of the error. This is used to get the file, line and function name where the error occurred.

Member Function Documentation

◆ message()

const std::string & engine::util::Error::message ( ) const
inline

Get the error message.

Returns
The error message.

◆ location()

std::source_location engine::util::Error::location ( ) const
inline

Get the location of the error.

Returns
The location of the error.

◆ report()

virtual std::string engine::util::Error::report ( ) const
inlinevirtual

Get the error report. You can override this method in derived classes to provide a more detailed error report.

Returns
The error report.

Reimplemented in engine::util::EngineError.

Member Data Documentation

◆ m_message

std::string engine::util::Error::m_message
private

◆ m_location

std::source_location engine::util::Error::m_location
private

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