# Embedded Scheduler Error States

The Embedded Scheduler can emit a `cronofyschedulererror` event for a number of reasons, and you may choose to subscribe to these. However, we handle all of the errors encountered during the development of this feature, rendering a helpful message to the user.

We hope that this gives you the confidence that:

- your engineers can more quickly resolve issues that arise during integration (relating to invalid token generation for example)

- your customers will receive helpful messaging, with guidance for how to resolve the issue in most cases

If you attempt to use the Embedded Scheduler in your browser's incognito mode/private window, you can see for yourself how the error messaging appears.

The `cronofyschedulererror` event that gets published is a [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent), that has a `detail` property with the following schema:

```
{
  code: 'token_expired'
}```
This allows your application to respond to errors on a case by case basis.

The full list of errors we currently return can be found [here](/developers/embedded-scheduler/error-states/index.md).

Below are some examples of the type of errors we emit, and the accompanying messaging:

## Incognito Mode - Private Browsing
```
code: 'missing_session_claim_secret' | 'missing_session_claim_token'```
We don't support the use of the Scheduler Embed anywhere that restricts cookie and local storage access. When a browser is in incognito mode or private browsing, after the user logs in, the authorization will ultimately fail.

You will see the following in this case:
![](/developers/embedded-scheduler/error-states/incognito-mode.f8970622a41960f2236c22c8f5dc51c1b544111a109e3b636fbd68863782a083.png)

## No Calendars Available
```
code: 'no_calendars'```
The user still needs to connect their calendar with Cronofy. The link will open the Cronofy app in a new tab, and ensure the user has connected a calendar.

The messaging in this case looks like this:
![](/developers/embedded-scheduler/error-states/no-calendars.2b6115b49cb54c3dcf476636df288d243bc5ad498fe22f979ab2438d28cd8ddd.png)

## Scheduling Request Not Found
```
code: `scheduling_request_not_found````
For the [cancel button](/developers/embedded-scheduler/index.md), we handle the error where the `SCHEDULING_REQUEST_ID` either does not exist, or the user does not have permission to access it.

See example:
![](/developers/embedded-scheduler/error-states/scheduling-request-not-found.d854f80b9deb9371010eb412e7592a4a667a13ba1d7e70beb13c97f87dfe6310.png)

## Token Expired
```
code: 'token_expired'```
When the token is expired we show the following message:
![](/developers/embedded-scheduler/error-states/token-expired.c0c4c579fa21dd93cd9d4c741142f595698246c504606215c2f95d9901023ecf.png)

## Error Codes
We currently return the following error codes:

- `token_iss_missing`

- `token_jti_missing`

- `token_aud_invalid`

- `token_iss_invalid`

- `token_iat_invalid`

- `token_valid_period_too_long`

- `token_expired`

- `token_invalid`

- `state_token_failure`

- `state_token_missing`

- `state_token_invalid`

- `unexpected_account_id_entity`

- `session_claim_verification_failure`

- `missing_session_claim_secret`

- `missing_session_claim_token`

- `no_calendars`

- `setup_incomplete`

- `scheduling_request_not_found`

- `scheduling_request_cancel_failed`


---
[Read in HTML](/developers/embedded-scheduler/error-states/)
