TimeoutException
Defined in: gadgets/exceptions.ts:102
Exception thrown when a gadget execution exceeds its timeout limit.
When a gadget’s execution time exceeds either:
- The gadget’s own
timeoutMsproperty, or - The global
defaultGadgetTimeoutMsconfigured in runtime/agent loop options
The executor will automatically throw this exception and return it as an error.
Example
Section titled “Example”import { z } from 'zod';
class SlowApiGadget extends Gadget({ name: 'SlowApi', description: 'Calls a slow external API', timeoutMs: 5000, // 5 second timeout schema: z.object({ endpoint: z.string(), }),}) { async execute(params: this['params']): Promise<string> { // If this takes longer than 5 seconds, execution will be aborted const response = await fetch(params.endpoint); return await response.text(); }}Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TimeoutException(
gadgetName,timeoutMs):TimeoutException
Defined in: gadgets/exceptions.ts:106
Parameters
Section titled “Parameters”gadgetName
Section titled “gadgetName”string
timeoutMs
Section titled “timeoutMs”number
Returns
Section titled “Returns”TimeoutException
Overrides
Section titled “Overrides”Error.constructor
Properties
Section titled “Properties”gadgetName
Section titled “gadgetName”
readonlygadgetName:string
Defined in: gadgets/exceptions.ts:104
timeoutMs
Section titled “timeoutMs”
readonlytimeoutMs:number
Defined in: gadgets/exceptions.ts:103