CancelledError.ts
12 lines
| 375 B
| video/mp2t
|
TypeScriptLexer
|
|
r172 | import { Cancellation } from "./Cancellation"; | ||
| import { ICancellation } from "./interfaces"; | ||||
| export class CancelledError extends Error { | ||||
| readonly cancellationToken: ICancellation; | ||||
| constructor(message = "The operation is cancelled", ct = Cancellation.none) { | ||||
| super(message); | ||||
| this.cancellationToken = ct; | ||||
| this.name = "CancelledError"; | ||||
| } | ||||
| } | ||||
