aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-11-24 18:59:16 +0100
committerdec05eba <dec05eba@protonmail.com>2024-11-24 18:59:16 +0100
commit9800cff631f1a82ee87005aabdefb3f5da7fadb5 (patch)
tree0a2de716518eb8e5a10e6f276dc2574ab0f0c420 /include
parent84a6eb51b0c54e8f2c5134ff9e3baf39f5da77cb (diff)
Throw InitException on mglpp init failure
Diffstat (limited to 'include')
-rw-r--r--include/mglpp/mglpp.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/mglpp/mglpp.hpp b/include/mglpp/mglpp.hpp
index 6e790af..dacd134 100644
--- a/include/mglpp/mglpp.hpp
+++ b/include/mglpp/mglpp.hpp
@@ -1,9 +1,19 @@
#ifndef MGLPP_MGLPP_HPP
#define MGLPP_MGLPP_HPP
+#include <stdexcept>
+
namespace mgl {
+ class InitException : public std::exception {
+ public:
+ const char* what() const noexcept override {
+ return "Failed to initialize mgl";
+ }
+ };
+
class Init {
public:
+ // Throws InitException on failure
Init();
~Init();
};