AgentsDataMap

global_error_keys

View as MarkdownOpen in Claude

Set error keys at the top-level data_map scope, regardless of webhook context. If any of these keys are present in a webhook response, the response is treated as an error.

Parameters

keys
list[str]Required

Response keys that indicate an error occurred.

Returns

DataMap — Self for method chaining.

Example

1from signalwire import DataMap, FunctionResult
2
3dm = DataMap("get_weather")
4dm.global_error_keys(["error", "fault", "exception"])
5dm.webhook("GET", "https://api.weather.com/v1/current?q=${args.city}")
6dm.output(FunctionResult("Weather: ${response.current.condition.text}"))