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
|
class Exception: public std::exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Exception() = delete;
|
explicit Exception()
|
||||||
Exception(const Exception &other) = delete;
|
: Exception("unspecified parser error")
|
||||||
Exception &operator=(const Exception &other) = delete;
|
{
|
||||||
Exception(Exception &&other) = default;
|
}
|
||||||
Exception &operator=(Exception &&other) = default;
|
|
||||||
|
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)
|
explicit Exception(const Location &location)
|
||||||
: Exception(location, "unspecified error")
|
: 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;
|
~Exception() noexcept = default;
|
||||||
|
|
||||||
const char *what() const noexcept
|
const char *what() const noexcept
|
||||||
|
Loading…
Reference in New Issue
Block a user