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 | List of all members
engine::util::UserError Class Reference

Represents an error that occurred in the user's code. More...

#include <Errors.hpp>

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

Public Member Functions

 Error (std::string message, std::source_location location=std::source_location::current())
 Construct an Error.
 
- Public Member Functions inherited from engine::util::Error
 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.
 

Detailed Description

Represents an error that occurred in the user's code.

This is meant to be used to report errors that occur in the user's code. It is not meant to be used to report errors that occur in the engine.

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.

Inherit from this class to create your own errors.

Member Function 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.

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