Skip to navigation

errorKeys

View as MarkdownOpen in Claude

Set error keys on the most recently added webhook. If any of these keys appear in that webhook’s response, the response is treated as an error. Call it after each webhook whose errors you want to detect.

With no webhook added yet, the keys go on the data_map object itself, like globalErrorKeys(), where SignalWire doesn’t read them.

Parameters

keys
string[]Required

List of JSON keys whose presence indicates an error.

Returns

DataMap — Self for method chaining.

Example

import { DataMap } from '@signalwire/sdk';
const dm = new DataMap('api_call');
dm.webhook('GET', 'https://api.example.com/data');
dm.errorKeys(['error', 'error_message']);