Added more constructor options for exceptions.
This commit is contained in:
parent
193b7f5c91
commit
830b8846d6
@ -19,11 +19,20 @@ namespace anthem
|
||||
class Exception: public std::exception
|
||||
{
|
||||
public:
|
||||
Exception() = delete;
|
||||
Exception(const Exception &other) = delete;
|
||||
Exception &operator=(const Exception &other) = delete;
|
||||
Exception(Exception &&other) = default;
|
||||
Exception &operator=(Exception &&other) = default;
|
||||
explicit Exception()
|
||||
: Exception("unspecified parser error")
|
||||
{
|
||||
}
|
||||
|
||||
explicit Exception(const char *message)
|
||||
: Exception(static_cast<std::string>(message))
|
||||
{
|
||||
}
|
||||
|
||||
explicit Exception(const std::string &message)
|
||||
: m_message{message}
|
||||
{
|
||||
}
|
||||
|
||||
explicit Exception(const Location &location)
|
||||
: Exception(location, "unspecified error")
|
||||
@ -44,6 +53,11 @@ class Exception: public std::exception
|
||||
{
|
||||
}
|
||||
|
||||
Exception(const Exception &other) = delete;
|
||||
Exception &operator=(const Exception &other) = delete;
|
||||
Exception(Exception &&other) = default;
|
||||
Exception &operator=(Exception &&other) = default;
|
||||
|
||||
~Exception() noexcept = default;
|
||||
|
||||
const char *what() const noexcept
|
||||
|
Loading…
Reference in New Issue
Block a user