CancellationException class

Thrown when work is abandoned because its CancellationToken was cancelled.

Implemented types

Constructors

CancellationException([Object? reason])
Creates a cancellation exception carrying an optional reason. Audited: 2026-06-12 11:26 EDT
const

Properties

hashCode int
The hash code for this object.
no setterinherited
reason Object?
Optional caller-supplied explanation for the cancellation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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