CancelledException class

Thrown when an operation is aborted via a CancellationToken.

Maps to StatusCode.cancelled. Catch this to distinguish a cooperative cancellation from other failures.

Inheritance

Constructors

CancelledException({Object? reason, CancellationToken? token})

Properties

cause → Object?
The underlying error this exception wraps, if any. In-process only: it is not serialized over the wire.
finalinherited
details → String?
Further details, e.g. a provider's response body.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
message → String
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackTrace → StackTrace?
The stack trace of cause, when it was captured.
finalinherited
status → StatusCode
The canonical status. Use StatusCode.value for the numeric code or StatusCode.httpStatus for the HTTP equivalent.
finalinherited
token → CancellationToken?
The token that produced this cancellation, when known.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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