diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-07-11 13:48:49 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-07-11 13:48:49 +0200 |
commit | cc43bdd85f6425372623ebfee9cace98fd63e330 (patch) | |
tree | 500893c265e8198d9440f580be47a6206245f7aa /src/core/error.h | |
parent | 5ca077154f9e1a41618e301d64f0cc1661d06214 (diff) |
c++,core: Added an error category get function
Diffstat (limited to 'src/core/error.h')
-rw-r--r-- | src/core/error.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/error.h b/src/core/error.h index d057877..e816734 100644 --- a/src/core/error.h +++ b/src/core/error.h @@ -35,6 +35,9 @@ public: error &operator=(error &&) = default; const std::string_view get_message() const; + + const std::string_view get_category() const; + bool failed() const; bool is_critical() const; @@ -73,6 +76,8 @@ public: SAW_FORBID_COPY(error_registry); SAW_FORBID_MOVE(error_registry); + error_or<const std::string_view> search_category(const error::code& id) const; + error_or<error::code> search_id(const std::string_view& desc) const; error_or<error::code> search_or_register_id(const std::string_view& desc, bool is_critical); @@ -131,7 +136,7 @@ struct critical { }; struct buffer_exhausted { - static constexpr std::string_view description = "Buffer is too small"; + static constexpr std::string_view description = "Buffer Exhausted"; static constexpr bool is_critical = false; }; |