|
FlatImage
A configurable Linux containerization system
|
Enhanced error handling framework built on std::expected. More...
#include <expected>#include <string>#include <array>#include <type_traits>#include "string.hpp"#include "../lib/log.hpp"Go to the source code of this file.
Classes | |
| struct | Value< T, E > |
| Enhanced expected type with integrated logging capabilities. More... | |
Macros | |
| #define | NOPT(expr, ...) |
| #define | NOPT_IDENTITY(...) |
| #define | NOPT_EAT(...) |
| #define | Pop(expr, ...) |
| #define | discard(fmt, ...) |
| #define | forward(fmt, ...) |
| #define | Try(expr, ...) |
| #define | Catch(expr, ...) |
| #define | Error(fmt, ...) |
Functions | |
| template<typename Fn> requires (not ns_concept::IsInstanceOf<std::invoke_result_t<Fn>, Value>) and (not ns_concept::IsInstanceOf<std::invoke_result_t<Fn>, std::expected>) | |
| auto | __except_impl (Fn &&f) -> Value< std::invoke_result_t< Fn > > |
| Convert exceptions to Value errors. | |
Variables | |
| constexpr auto | __expected_fn = [](auto&& e) { return e; } |
| Lambda helper for Pop macro error returns. | |
Enhanced error handling framework built on std::expected.
This module provides a sophisticated error handling system that extends C++23's std::expected with integrated logging capabilities, convenient macros for error propagation, and utilities for exception handling.
Key Components:
Definition in file expected.hpp.
| #define Catch | ( | expr, | |
| ... ) |
Definition at line 311 of file expected.hpp.
| #define discard | ( | fmt, | |
| ... ) |
Definition at line 224 of file expected.hpp.
| #define Error | ( | fmt, | |
| ... ) |
Definition at line 335 of file expected.hpp.
| #define forward | ( | fmt, | |
| ... ) |
Definition at line 238 of file expected.hpp.
| #define NOPT | ( | expr, | |
| ... ) |
Definition at line 154 of file expected.hpp.
| #define NOPT_EAT | ( | ... | ) |
Definition at line 156 of file expected.hpp.
| #define NOPT_IDENTITY | ( | ... | ) |
Definition at line 155 of file expected.hpp.
| #define Pop | ( | expr, | |
| ... ) |
Definition at line 184 of file expected.hpp.
| #define Try | ( | expr, | |
| ... ) |
Definition at line 295 of file expected.hpp.
| auto __except_impl | ( | Fn && | f | ) | -> Value<std::invoke_result_t<Fn>> |
Convert exceptions to Value errors.
Executes a callable and catches any exceptions, converting them to Value errors with appropriate logging.
| Fn | Callable type |
| f | Function to execute with exception handling |
Definition at line 254 of file expected.hpp.
|
constexpr |
Lambda helper for Pop macro error returns.
Definition at line 147 of file expected.hpp.