Skip to content

CancelledError

1 min read

No import is needed.

Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.

CancelledError

Error raised when a cooperative cancellation token is already cancelled.

public class CancelledError: Error

constructor

Creates a CancelledError with message.

public constructor(message: string)

message

Human-readable explanation of the cancellation, suitable for logs and error output.

public fun message(): string

code

Stable machine code.

public fun code(): string

cancelled

Factory for a standard cancelled error.

public static fun cancelled(): CancelledError