cangine
Loading...
Searching...
No Matches
exception.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <exception>
12 class CangineException : public std::exception {
13 public:
14 std::string message;
19 inline CangineException(std::string msg) : message("cangine err: " + msg) {};
24 inline virtual const char* what() const noexcept override {
25 return message.c_str();
26 }
27 };
28
29
36 public:
41 inline ShaderException(std::string msg) : CangineException("shader err: " + msg) {};
42 };
43}
Base class for all engine exceptions.
Definition exception.hpp:12
CangineException(std::string msg)
Constructs the exception with a message.
Definition exception.hpp:19
std::string message
Full formatted error message.
Definition exception.hpp:14
virtual const char * what() const noexcept override
Returns the formatted error message.
Definition exception.hpp:24
Exception thrown for shader compilation/linking failures.
Definition exception.hpp:35
ShaderException(std::string msg)
Constructs the exception with a message.
Definition exception.hpp:41
Exception types thrown by the engine.
Definition exception.hpp:6