nstool/lib/fnd/exception.h
2017-07-03 01:18:59 +10:00

36 lines
710 B
C++

#pragma once
#include <exception>
#include <string>
namespace fnd
{
class Exception : public std::exception
{
public:
enum ExceptionLevel
{
E_RECOVERABLE,
E_FATAL,
};
Exception() noexcept;
Exception(const std::string& what) noexcept;
Exception(const std::string& what, ExceptionLevel level) noexcept;
Exception(const std::string& module, const std::string& what) noexcept;
Exception(const std::string& module, const std::string& what, ExceptionLevel level) noexcept;
~Exception();
const char* what() const noexcept;
const char* module() const noexcept;
bool is_fatal() const noexcept;
private:
std::string what_;
std::string module_;
ExceptionLevel level_;
};
}