One uniform error record.
More...
#include <error.hpp>
One uniform error record.
Consumed by every observable error face in the framework (AsyncCommand::last_error, AsyncResource::error, ValidationState::errors, ...).
◆ is_error()
| bool aria::Error::is_error |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ is_warning()
| bool aria::Error::is_warning |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ is_cancellation()
| bool aria::Error::is_cancellation |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ to_string()
| std::string aria::Error::to_string |
( |
| ) |
const |
|
inlinenodiscard |
◆ validation()
Hard validation error.
Callers usually go through Validator/FormValidator, which build these for them.
◆ validation_warning()
Soft validation advisory (severity = Warning).
◆ async_failure()
| Error aria::Error::async_failure |
( |
std::string | msg, |
|
|
std::string | source_tag = "AsyncCommand", |
|
|
std::exception_ptr | inner = {} ) |
|
inlinestaticnodiscard |
Async failure with optional inner exception_ptr preserved.
◆ cancellation()
| Error aria::Error::cancellation |
( |
std::string | source_tag = "AsyncCommand" | ) |
|
|
inlinestaticnodiscard |
Cancellation.
Always Severity::Error (consumers can opt to render it as nothing). Source tag defaults to "AsyncCommand" because that is by far the most common emitter.
◆ timeout()
| Error aria::Error::timeout |
( |
std::string | source_tag = "AsyncCommand" | ) |
|
|
inlinestaticnodiscard |
with_timeout deadline expired.
◆ user_error()
| Error aria::Error::user_error |
( |
std::string | msg, |
|
|
std::string | source_tag = {} ) |
|
inlinestaticnodiscard |
Bad caller argument (mirrors std::invalid_argument / std::out_of_range).
◆ graph_cycle()
| Error aria::Error::graph_cycle |
( |
std::string | msg, |
|
|
std::exception_ptr | inner = {} ) |
|
inlinestaticnodiscard |
◆ from_exception()
| Error aria::Error::from_exception |
( |
std::exception_ptr | ex, |
|
|
std::string | source_tag ) |
|
inlinestaticnodiscard |
Catch-all converter from a thrown exception_ptr to a typed Error.
Recognises:
- std::invalid_argument / std::out_of_range -> UserError
- std::exception -> AsyncFailure
- unknown -> AsyncFailure
Aria's own sentinel exception types (OperationCancelled, TimeoutError, CircularDependencyError) are intentionally NOT recognised here, because doing so would force error.hpp to back-include async/cancellation.hpp etc. and reverse the module dependency. Each error-face site (e.g. aria::async::detail::process_async_exception) catches the sentinel first and calls a precise factory (Error::cancellation(), Error::timeout(), Error::graph_cycle()); only the residual reaches from_exception.
source_tag lets the call site annotate "where did this come
from"; pick a stable string ("AsyncCommand", "AsyncResource", ...) so consumers can route on it.
◆ kind
◆ severity
◆ message
| std::string aria::Error::message |
◆ source
| std::string aria::Error::source |
Free-form locator: which subsystem produced this.
Stable strings such as "AsyncCommand", "AsyncResource", "Validator", "FormValidator", "Graph", "Binding". Empty if unknown.
◆ key
For kind == Validation: the (field_path, rule_id) locator.
Empty for every other kind (still a valid ValidationKey, just with empty strings).
◆ inner
| std::exception_ptr aria::Error::inner |
Optional original exception.
Most consumers never need it; it is intentionally not part of equality (see operator== below) because exception_ptrs are pointer-identity-compared and that would break observer change detection on no-op resets.
The documentation for this struct was generated from the following file: