> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # RelayError > Error thrown when the Relay server returns an error. Custom error class for Relay protocol errors. Extends JavaScript's built-in `Error` class. The `name` property is always `"RelayError"`. ```typescript {1} import { RelayError } from '@signalwire/sdk'; ``` ## **Properties** **`code`** `number` Numeric error code returned by the Relay server. --- **`message`** `string` `"RELAY error {code}: {serverMessage}"`. The standard `Error` message, prefixed with the code. --- **`serverMessage`** `string` The server's own error text, without the `RELAY error` prefix. Read this to match on or display the server's wording. --- **`name`** `string` Always `"RelayError"`. --- ## **Examples** ### Catch a Relay error ```typescript {9} import { RelayClient, RelayError } from '@signalwire/sdk'; const client = new RelayClient({ project: process.env.SIGNALWIRE_PROJECT_ID!, token: process.env.SIGNALWIRE_API_TOKEN!, contexts: ['default'], }); client.onCall(async (call) => { try { await call.connect( [[{ type: 'phone', params: { to_number: '+15559876543' } }]], ); } catch (e) { if (e instanceof RelayError) { console.log(`Error ${e.code}: ${e.message}`); } await call.hangup(); } }); await client.run(); ``` > Error thrown when the Relay server returns an error.