diff options
Diffstat (limited to 'forstio/core/error.h')
-rw-r--r-- | forstio/core/error.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/forstio/core/error.h b/forstio/core/error.h index 304b375..9708a07 100644 --- a/forstio/core/error.h +++ b/forstio/core/error.h @@ -115,6 +115,16 @@ struct no_error { static constexpr bool is_critical = false; }; +struct recoverable { + static constexpr std::string_view description = "No error has occured"; + static constexpr bool is_critical = false; +}; + +struct critical { + static constexpr std::string_view description = "No error has occured"; + static constexpr bool is_critical = true; +}; + struct buffer_exhausted { static constexpr std::string_view description = "Buffer is too small"; static constexpr bool is_critical = false; @@ -129,6 +139,16 @@ struct out_of_memory { static constexpr std::string_view description = "Out of memory"; static constexpr bool is_critical = true; }; + +struct invalid_state { + static constexpr std::string_view description = "Invalid state"; + static constexpr bool is_critical = true; +}; + +struct not_supported { + static constexpr std::string_view description = "Not supported"; + static constexpr bool is_critical = false; +}; } /** @@ -163,7 +183,7 @@ private: "Don't use internal private types"); public: - error_or() = default; + error_or():value_or_error_{fix_void<T>{}}{} error_or(const fix_void<T> &value) : value_or_error_{value} {} error_or(fix_void<T> &&value) : value_or_error_{std::move(value)} {} |