# TryYourSizeError

> Every error the SDK throws or emits: a stable type and code to branch on, a message, and a link to its explanation.

Source: https://docs.tryyoursize.com/reference/web/tryyoursize-error/

*Class* · `@tryyoursize/sdk`

Every error the SDK throws or emits: a stable `type` and `code` to branch on, a message, and a link to its explanation.

```ts
class TryYourSizeError extends Error
```

## Properties

- **`type`** (`ErrorType`, required): `"integration_error"` (fix your code) or `"load_error"` (network, CSP).
- **`code`** (`ErrorCode`, required): A stable code. All codes: [Web SDK errors](https://docs.tryyoursize.com/sdk/errors.md).
- **`docUrl`** (`string`, required): Link to the code's explanation.

## Example

**JavaScript**

```js
try {
  TryYourSize(key);
} catch (e) {
  if (e instanceof TryYourSizeError && e.code === "invalid_key") showConfigError();
}
```
