24#ifndef NAWA_EXCEPTION_H
25#define NAWA_EXCEPTION_H
38 std::string debugMessage;
47 Exception(
const std::string& inFunction,
int errorCode,
const std::string& message =
"No message provided.",
48 const std::string& additionalDebugInfo = std::string())
49 : errorCode(errorCode),
51 std::stringstream mstream;
52 mstream <<
"[NAWA Exception #" << errorCode <<
" in " << inFunction <<
"] " << message;
53 if (!additionalDebugInfo.empty()) {
54 mstream <<
" [Debug Info:] " << additionalDebugInfo;
56 debugMessage = mstream.str();
71 [[nodiscard]]
virtual std::string
getMessage() const noexcept {
88 char const*
what() const noexcept
override {
89 return debugMessage.c_str();
char const * what() const noexcept override
virtual int getErrorCode() const noexcept
virtual std::string getMessage() const noexcept
virtual std::string getDebugMessage() const noexcept
Exception(const std::string &inFunction, int errorCode, const std::string &message="No message provided.", const std::string &additionalDebugInfo=std::string())