---
url: >-
  https://game-engine-io.github.io/enginex-frontend-sdk/reference/api/@getenginex/sdk/functions/isEnginexError.md
---
[Reference](../../../index.md) / [@getenginex/sdk](../index.md) / isEnginexError

# isEnginexError()

## Call Signature

> **isEnginexError**(`value`): `value is EnginexError`

Tells whether the value is an [EnginexError](../classes/EnginexError.md).

### Parameters

#### value

`unknown`

### Returns

`value is EnginexError`

## Call Signature

> **isEnginexError**<`C`>(`value`, `code`): `value is EnginexError & { code: C; details: C extends "captcha_required" ? ErrorDetailsMap[C] : unknown }`

Tells whether the value is an [EnginexError](../classes/EnginexError.md) with the given code. When `code` is in
[ErrorDetailsMap](../interfaces/ErrorDetailsMap.md) (e.g. `'captcha_required'`), `details` comes typed; otherwise, `unknown`.

### Type Parameters

#### C

`C` *extends* [`EnginexErrorCode`](../type-aliases/EnginexErrorCode.md)

### Parameters

#### value

`unknown`

#### code

`C`

### Returns

`value is EnginexError & { code: C; details: C extends "captcha_required" ? ErrorDetailsMap[C] : unknown }`

### Example

```ts
if (isEnginexError(e, 'captcha_required')) showCaptcha(e.details?.site_key)
```
