diff options
author | Claudius Holeksa <mail@keldu.de> | 2023-05-02 17:54:06 +0200 |
---|---|---|
committer | Claudius Holeksa <mail@keldu.de> | 2023-05-02 17:54:06 +0200 |
commit | 652c5eb52338111b89de5842ec2c63c4f693debc (patch) | |
tree | ec2c591fe9189f10acead8cf07b4d82225d6fbdc /forstio/core | |
parent | 3b14232d439428e1536e1fbe06e9d64a61a275a4 (diff) |
c++: renamed to snake_case and changed to new errors in io-tls
Diffstat (limited to 'forstio/core')
-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)} {} |