Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions clerk-typedoc/shared/missing-expired-token-error.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Error class representing a missing expired token error from the API.
This error occurs when the server requires an expired token to mint a new session token.

Use the static `is` method to check if a ClerkAPIResponseError matches this error type.

## Example

```typescript
if (MissingExpiredTokenError.is(error)) {
// Handle the missing expired token error
}
```

## is()

Type guard to check if an error is a MissingExpiredTokenError.
This checks the error's properties (status and error code) rather than instanceof,
allowing it to work with ClerkAPIResponseError instances thrown from the API layer.

### Parameters

| Parameter | Type |
| --------- | --------- |
| `err` | `unknown` |

### Returns

`err is ClerkAPIResponseError`

### Example

```typescript
try {
await someApiCall();
} catch (e) {
if (MissingExpiredTokenError.is(e)) {
// e is typed as ClerkAPIResponseError with the specific error properties
}
}
```