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

# DeviceTokenError

> Thrown when device token issuance or validation fails.

Raised when the SDK cannot obtain or validate a device token from the auth backend. Surfaces both during the initial token exchange and on subsequent re-issue attempts. When this fires the session is not authenticated; check the underlying error for HTTP-status detail and decide whether to prompt the user to re-authenticate or retry.

## **Extends**

* `Error`

## **Constructors**

### Constructor

```ts
new DeviceTokenError(message, originalError?): DeviceTokenError
```

### Parameters

Human-readable error message.

Underlying error raised during device-token issuance or validation.

## **Properties**

Underlying error raised during device-token issuance or validation.

## **Examples**

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

client.errors$.subscribe((err) => {
  if (err instanceof DeviceTokenError) {
    console.error('device token failure:', err.message, err.originalError);
    redirectToLogin();
  }
});
```