We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e89a07a commit 5d78642Copy full SHA for 5d78642
include/mrdox/Support/Error.hpp
@@ -14,6 +14,7 @@
14
15
#include <mrdox/Platform.hpp>
16
#include <fmt/format.h>
17
+#include <exception>
18
#include <string>
19
#include <string_view>
20
#include <type_traits>
@@ -24,7 +25,8 @@ namespace mrdox {
24
25
26
/** Holds the description of an error, or success.
27
*/
-class [[nodiscard]] Error
28
+class [[nodiscard]] MRDOX_DECL
29
+ Error : public std::exception
30
{
31
std::string text_;
32
@@ -119,6 +121,14 @@ class [[nodiscard]] Error
119
121
return text_;
120
122
}
123
124
+ /** Return a null-terminated error string.
125
+ */
126
+ char const*
127
+ what() const noexcept override
128
+ {
129
+ return text_.c_str();
130
+ }
131
+
132
/** Return a value indicating success.
133
134
static
0 commit comments