AbortException
Defined in: gadgets/exceptions.ts:143
Exception thrown when gadget execution is aborted.
Gadgets can throw this exception when they detect the abort signal has been
triggered. This is typically used via the throwIfAborted() helper method
on the Gadget base class.
Example
Section titled “Example”class LongRunningGadget extends Gadget({ name: 'LongRunning', description: 'Performs a long operation with checkpoints', schema: z.object({ data: z.string() }),}) { async execute(params: this['params'], ctx: ExecutionContext): Promise<string> { // Check at key points - throws AbortException if aborted this.throwIfAborted(ctx);
await this.doPartOne(params.data);
this.throwIfAborted(ctx);
await this.doPartTwo(params.data);
return 'completed'; }}Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AbortException(
message?):AbortException
Defined in: gadgets/exceptions.ts:144
Parameters
Section titled “Parameters”message?
Section titled “message?”string
Returns
Section titled “Returns”AbortException
Overrides
Section titled “Overrides”Error.constructor