> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# PreflightError

> Error thrown when the preflight connectivity test fails.

Raised by [`SignalWire.preflight`](/docs/browser-sdk/v4/reference/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

```ts
new PreflightError(phase, originalError?): PreflightError
```

### Parameters

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

Underlying error raised during preflight.

## **Properties**

Underlying error raised during preflight.

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

## **Examples**

```ts
import { PreflightError } from '@signalwire/js';

try {
  const result = await client.preflight('/preflight-endpoint');
} catch (err) {
  if (err instanceof PreflightError) {
    console.error(`preflight failed at ${err.phase}:`, err.originalError);
  }
}
```