Skip to navigation

globalErrorKeys

View as MarkdownOpen in Claude

Set error_keys on the data_map object itself, regardless of webhook context.

SignalWire reads error_keys only on a webhook, so keys set here don’t mark any response as an error. To detect errors, call errorKeys() after each webhook.

Parameters

keys
string[]Required

Response keys that indicate an error occurred.

Returns

DataMap — Self for method chaining.

Example

The keys land on the data_map object, not on the webhook:

import { DataMap, FunctionResult } from '@signalwire/sdk';
const dm = new DataMap('get_weather');
dm.globalErrorKeys(['error', 'fault', 'exception']);
dm.webhook('GET', 'https://api.weather.com/v1/current?q=${args.city}');
dm.output(new FunctionResult('Weather: ${current.condition.text}'));