Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add docs about error event #541

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions js-sdk/api/core_package/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,15 @@ except we intercept all events, not just selection.
```ts
tolgee.on('update', handler: ListenerHandler<void>)
```

### error

Emitted when there is an error. You can intercept different types of errors, connected to fetching language data, detecting language or loading/storing language, you can filter them by `name` property on the error, which can be:
- `RecordFetchError` - error when fetching translations record, you can also read `language` and `namespace` properties, to see which record has failed
- `LanguageDetectorError` - error when detecting language through language detector plugin
- `LanguageStorageError` - error when loading/saving language through language storage plugin

```ts
tolgee.on('error', handler: ListenerHandler<TolgeeError>)
```

Loading