From 5d786428bb02ef21ba5a83b3acd007d3a07aeb18 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 15 Jun 2023 16:58:39 -0700 Subject: [PATCH] chore: Error is an exception --- include/mrdox/Support/Error.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/mrdox/Support/Error.hpp b/include/mrdox/Support/Error.hpp index ec0f88010..175e7caea 100644 --- a/include/mrdox/Support/Error.hpp +++ b/include/mrdox/Support/Error.hpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -24,7 +25,8 @@ namespace mrdox { /** Holds the description of an error, or success. */ -class [[nodiscard]] Error +class [[nodiscard]] MRDOX_DECL + Error : public std::exception { std::string text_; @@ -119,6 +121,14 @@ class [[nodiscard]] Error return text_; } + /** Return a null-terminated error string. + */ + char const* + what() const noexcept override + { + return text_.c_str(); + } + /** Return a value indicating success. */ static