libmx2 2.2.1
C++20 multimedia and game-engine library (SDL2 / OpenGL / Vulkan)
Loading...
Searching...
No Matches
mx::Exception Class Reference

General-purpose exception class for the mx library. More...

#include <exception.hpp>

Collaboration diagram for mx::Exception:
[legend]

Public Member Functions

 Exception (const std::string &text_)
 Construct an exception with the given message.
std::string text () const
 Retrieve the error message.

Private Attributes

std::string text_value
 Stored error message.

Detailed Description

General-purpose exception class for the mx library.

Wraps a human-readable error message that can be retrieved via text(). Throw this instead of std::exception wherever a libmx error occurs.

Definition at line 20 of file exception.hpp.

Constructor & Destructor Documentation

◆ Exception()

mx::Exception::Exception ( const std::string & text_)
explicit

Construct an exception with the given message.

Parameters
text_Human-readable description of the error.

Definition at line 8 of file exception.cpp.

References text_value.

Member Function Documentation

◆ text()

std::string mx::Exception::text ( ) const

Retrieve the error message.

Returns
The message string passed at construction.

Definition at line 9 of file exception.cpp.

References text_value.

Referenced by mx::VKWindow::createGraphicsPipeline(), mx::Model::openModel(), and mx::Model::setTextures().

Member Data Documentation

◆ text_value

std::string mx::Exception::text_value
private

Stored error message.

Definition at line 34 of file exception.hpp.

Referenced by Exception(), and text().


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