From 652c5eb52338111b89de5842ec2c63c4f693debc Mon Sep 17 00:00:00 2001 From: Claudius Holeksa Date: Tue, 2 May 2023 17:54:06 +0200 Subject: c++: renamed to snake_case and changed to new errors in io-tls --- forstio/core/error.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'forstio/core') 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{}}{} error_or(const fix_void &value) : value_or_error_{value} {} error_or(fix_void &&value) : value_or_error_{std::move(value)} {} -- cgit v1.2.3