Skip to content

Commit

Permalink
chore: Error is an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Jun 16, 2023
1 parent e89a07a commit 5d78642
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion include/mrdox/Support/Error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <mrdox/Platform.hpp>
#include <fmt/format.h>
#include <exception>
#include <string>
#include <string_view>
#include <type_traits>
Expand All @@ -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_;

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5d78642

Please sign in to comment.