UnexpectedError

View as MarkdownOpen in Claude

Catch-all wrapper used when the SDK encounters a condition that doesn’t map to one of the typed error classes. The at property records where the wrap occurred and options.cause (standard ErrorOptions) carries the original throwable. Treat this as a bug signal — any occurrence merits filing an issue with the at value and the underlying cause attached.

Extends

  • Error

Constructors

Constructor

1new UnexpectedError(at?, options?): UnexpectedError

Parameters

at
string

Location where the error was raised, for diagnostics.

options
ErrorOptions

Standard ErrorOptions (e.g. cause).

Returns

UnexpectedError

Properties

at
string

Location where the error was raised, for diagnostics.

Examples

1import { UnexpectedError } from '@signalwire/js';
2
3client.errors$.subscribe((err) => {
4 if (err instanceof UnexpectedError) {
5 console.error(`unexpected error at ${err.at}:`, err.cause);
6 reportToTelemetry(err);
7 }
8});