> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# convertError()

- Package: [@gooddata/sdk-ui](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/index.md)
- Kind: function
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui/src/base/errors/errorHandling.ts
- Guides: [Handle errors](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/interactivity/handle-errors/index.md)

Converts any error into an instance of [GoodDataSdkError](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.gooddatasdkerror/index.md).

**Signature:**

```typescript
export declare function convertError(error: unknown): GoodDataSdkError;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| error | unknown | error to convert |

**Returns:**

[GoodDataSdkError](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.gooddatasdkerror/index.md)

new instance of GoodDataSdkError

## Remarks

The conversion logic right now focuses mostly on errors that are contractually specified in Analytical Backend SPI. All other unexpected errors are wrapped into an exception with the generic 'UNKNOWN\_ERROR' code.

Instances of GoodDataSdkError are returned as-is and are not subject to any processing.
