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 Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
engine::util::EngineError Class Referencefinal

Represents an error that occurred in the engine. More...

#include <Errors.hpp>

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

Public Types

enum class  Type {
  Unimplemented , ShouldNotReachHere , GuaranteeViolation , FileNotFound ,
  ConfigurationError , ShaderCompilationError , OpenGLError , AssetLoadingError ,
  EngineErrorCount
}
 The type of the engine error. More...
 

Public Member Functions

 EngineError (Type error_type, std::string message, std::source_location location=std::source_location::current())
 Construct an EngineError.
 
std::string report () const override
 Get the error report.
 
- 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.
 

Static Public Member Functions

static std::string_view type_string (Type error)
 Get the string representation of the engine error type.
 

Private Attributes

Type m_error
 

Detailed Description

Represents an error that occurred in the engine.

Member Enumeration Documentation

◆ Type

The type of the engine error.

Enumerator
Unimplemented 

The error that occurs when a function is not implemented. Use this during development to mark a function as not implemented yet. It is not meant to be thrown in production.

ShouldNotReachHere 

The error that occurs when a function should not reach a certain point. Use this to mark a path that should not be reached. If it is reached, it means that the program is in an inconsistent state.

GuaranteeViolation 

The error that occurs when a guarantee is violated.

FileNotFound 

The error that occurs when a file is not found.

ConfigurationError 

The error that occurs when a configuration is invalid.

ShaderCompilationError 

The error that occurs when a shader compilation fails.

OpenGLError 

The error that occurs when an OpenGL error occurs.

AssetLoadingError 

The error that occurs when an asset loading fails.

EngineErrorCount 

Constructor & Destructor Documentation

◆ EngineError()

engine::util::EngineError::EngineError ( Type  error_type,
std::string  message,
std::source_location  location = std::source_location::current() 
)
inline

Construct an EngineError.

Parameters
error_typeThe type of the engine error.
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

◆ type_string()

std::string_view engine::util::EngineError::type_string ( Type  error)
static

Get the string representation of the engine error type.

Parameters
errorThe engine error type.
Returns
The string representation of the engine error type.

◆ report()

std::string engine::util::EngineError::report ( ) const
overridevirtual

Get the error report.

Returns
The error report.

Reimplemented from engine::util::Error.

Member Data Documentation

◆ m_error

Type engine::util::EngineError::m_error
private

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