PreflightError

View as MarkdownOpen in Claude

Raised by SignalWire.preflight when the connectivity test fails at one of its phases. Inspect phase to discriminate (signaling, media, connectivity) — failure at the signaling phase usually means the user’s network blocks the transport; failure at the media phase usually means device-permission or codec issues.

Extends

  • Error

Constructors

Constructor

1new PreflightError(phase, originalError?): PreflightError

Parameters

phase
stringRequired

Preflight phase where the failure occurred (e.g. signaling, media, connectivity).

originalError
unknown

Underlying error raised during preflight.

Properties

originalError
unknown

Underlying error raised during preflight.

phase
stringRequired

Preflight phase where the failure occurred (e.g. signaling, media, connectivity).

Examples

1import { PreflightError } from '@signalwire/js';
2
3try {
4 const result = await client.preflight('/preflight-endpoint');
5} catch (err) {
6 if (err instanceof PreflightError) {
7 console.error(`preflight failed at ${err.phase}:`, err.originalError);
8 }
9}