UnexpectedException class final

Wraps an error that escaped from outside the framework.

Used at adapter boundaries so that no non-AgenticException ever reaches application code from a framework entry point. The original error is always preserved in AgenticException.cause.

Inheritance

Constructors

UnexpectedException(String message, {required Object? cause, StackTrace? causeStackTrace, String? component, Map<String, Object?> details = const <String, Object?>{}})
Creates a wrapper around an unclassified cause.

Properties

annotations Map<String, Object?>
Context added by layers the error passed through on its way out.
finalinherited
cause Object?
The lower-level error that triggered this failure, when there was one.
finalinherited
causeStackTrace StackTrace?
The stack trace captured where cause was caught.
finalinherited
code String
Stable machine-readable identifier for this class of failure.
no setteroverride
component String?
The component the error escaped from, such as agent:researcher.
final
details Map<String, Object?>
Structured, unmodifiable diagnostic context supplied at construction.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
isRetryable bool
Unknown errors are treated as non-transient.
no setteroverride
message String
Human-readable description of what went wrong.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

annotate(String key, Object? value) → void
Records value under key unless key is already present.
inherited
annotateAll(Map<String, Object?> context) → void
Records every entry of context through annotate.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
Serialises this exception for logs, traces and crash reports.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited