# SDKError.code

```ts
readonly code: ErrorCodeValue
```

Machine-readable error code — one of the twenty `ErrorCode` values listed under [Errors](https://kernstra.com/docs/web-sdk/api/errors). Switch on it, with `ErrorCode.X` or the string.

- Kind: property
- Since: 1.0.0

Returns `ErrorCodeValue`

```ts
if (err instanceof SDKError && err.code === 'PASSWORD_ERROR') {
  askForPassword();
}
```

Part of [SDKError](https://kernstra.com/docs/web-sdk/api/sdkerror) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/sdkerror/code
