From 9800cff631f1a82ee87005aabdefb3f5da7fadb5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 24 Nov 2024 18:59:16 +0100 Subject: Throw InitException on mglpp init failure --- include/mglpp/mglpp.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') 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 + 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(); }; -- cgit v1.2.3-70-g09d2