159 if (!
source.empty()) { out.push_back(
':'); out.append(
source); }
172 std::move(msg),
"Validator", std::move(k), {}};
178 std::move(msg),
"Validator", std::move(k), {}};
183 std::string source_tag =
"AsyncCommand",
184 std::exception_ptr
inner = {}) {
186 std::move(msg), std::move(source_tag), {}, std::move(
inner)};
194 "operation cancelled", std::move(source_tag), {}, {}};
198 [[nodiscard]]
static Error timeout(std::string source_tag =
"AsyncCommand") {
200 "operation timed out", std::move(source_tag), {}, {}};
207 std::move(msg), std::move(source_tag), {}, {}};
212 std::exception_ptr
inner = {}) {
214 std::move(msg),
"Graph", {}, std::move(
inner)};
238 std::string source_tag) {
241 std::move(source_tag), {});
244 std::rethrow_exception(ex);
245 }
catch (
const std::invalid_argument& e) {
247 std::move(source_tag), {}, ex};
248 }
catch (
const std::out_of_range& e) {
250 std::move(source_tag), {}, ex};
251 }
catch (
const std::exception& e) {
255 std::move(source_tag), ex);
265 return a.kind == b.kind
266 && a.severity == b.severity
267 && a.message == b.message
268 && a.source == b.source
ErrorKind
Coarse classification of every error Aria can surface.
Definition error.hpp:65
@ Validation
A validator rule failed.
Definition error.hpp:74
@ Cancellation
An OperationCancelled propagated through the async pipeline.
Definition error.hpp:84
@ UserError
Caller passed something the API explicitly forbids (null view model, out-of-range index,...
Definition error.hpp:69
@ BindingFailure
View / adapter side-effect failed (e.g.
Definition error.hpp:92
@ GraphCycle
A reactive dependency cycle or non-converging flush was detected.
Definition error.hpp:96
@ Timeout
A with_timeout deadline elapsed (either Race or Fail mode).
Definition error.hpp:87
@ InvariantViolation
A documented framework invariant was violated at runtime (reserved for stress / fuzz reporting; never...
Definition error.hpp:101
@ AsyncFailure
An asynchronous body threw a non-cancellation, non-timeout exception.
Definition error.hpp:79
std::ostream & operator<<(std::ostream &os, const Error &e)
Definition error.hpp:275
@ Validation
Validator / FormValidator rule runs.
Definition diagnostics.hpp:71
bool operator!=(const Error &a, const Error &b) noexcept
Definition error.hpp:271
bool operator==(const Error &a, const Error &b) noexcept
Definition error.hpp:264
std::string_view to_string(TraceCategory c) noexcept
Definition diagnostics.hpp:75
Severity
Severity of a single error / warning.
Definition validation_key.hpp:42
@ Warning
Definition validation_key.hpp:44
@ Error
Definition validation_key.hpp:43
One uniform error record.
Definition error.hpp:129
static Error from_exception(std::exception_ptr ex, std::string source_tag)
Catch-all converter from a thrown exception_ptr to a typed Error.
Definition error.hpp:237
bool is_cancellation() const noexcept
Definition error.hpp:150
std::string message
Definition error.hpp:132
static Error validation(ValidationKey k, std::string msg)
Hard validation error.
Definition error.hpp:170
std::string to_string() const
Stable single-line render: <kind>:<source>:<key>: <message>.
Definition error.hpp:156
static Error cancellation(std::string source_tag="AsyncCommand")
Cancellation.
Definition error.hpp:192
std::string source
Free-form locator: which subsystem produced this.
Definition error.hpp:136
Severity severity
Definition error.hpp:131
ValidationKey key
For kind == Validation: the (field_path, rule_id) locator.
Definition error.hpp:140
ErrorKind kind
Definition error.hpp:130
static Error timeout(std::string source_tag="AsyncCommand")
with_timeout deadline expired.
Definition error.hpp:198
std::exception_ptr inner
Optional original exception.
Definition error.hpp:145
bool is_warning() const noexcept
Definition error.hpp:148
bool is_error() const noexcept
Definition error.hpp:147
static Error user_error(std::string msg, std::string source_tag={})
Bad caller argument (mirrors std::invalid_argument / std::out_of_range).
Definition error.hpp:205
static Error graph_cycle(std::string msg, std::exception_ptr inner={})
Reactive graph cycle (mirrors CircularDependencyError).
Definition error.hpp:211
static Error async_failure(std::string msg, std::string source_tag="AsyncCommand", std::exception_ptr inner={})
Async failure with optional inner exception_ptr preserved.
Definition error.hpp:182
static Error validation_warning(ValidationKey k, std::string msg)
Soft validation advisory (severity = Warning).
Definition error.hpp:176
(field_path, rule_id) locator for a validation message.
Definition validation_key.hpp:52
bool empty() const noexcept
Definition validation_key.hpp:56
std::string to_string() const
Stable string view of the form "<field_path>#<rule_id>".
Definition validation_key.hpp:61