From d47e807a5d8173cbbc8756c0bc774fb081c6c53e Mon Sep 17 00:00:00 2001 From: Nav Date: Tue, 13 Feb 2024 20:47:08 +0000 Subject: [PATCH] Added new exception class for internal fatal errors --- .../InternalFatalErrorException.hpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/Exceptions/InternalFatalErrorException.hpp diff --git a/src/Exceptions/InternalFatalErrorException.hpp b/src/Exceptions/InternalFatalErrorException.hpp new file mode 100644 index 00000000..d700b01d --- /dev/null +++ b/src/Exceptions/InternalFatalErrorException.hpp @@ -0,0 +1,22 @@ +#pragma once + +#include "Exception.hpp" +#include "src/Services/PathService.hpp" + +namespace Exceptions +{ + class InternalFatalErrorException: public Exception + { + public: + explicit InternalFatalErrorException(const std::string& message) + : Exception( + "Internal fatal error - " + message + " - please report this via " + + Services::PathService::homeDomainName() + "/report-issue" + ) + {} + + explicit InternalFatalErrorException(const char* message) + : InternalFatalErrorException(std::string(message)) + {} + }; +}