@snap/camera-kit
Version:
Camera Kit Web
24 lines (16 loc) • 767 B
Markdown
[**CameraKit Web SDK v1.13.0**](../README.md)
***
[CameraKit Web SDK](../globals.md) / LensExecutionError
# Type Alias: LensExecutionError
> **LensExecutionError**: `NamedError`\<`"LensExecutionError"`\>
This error occurs if a Lens is unable to continue rendering.
If this error occurs, Camera Kit automatically removes the Lens from the session.
It's always a good idea to handle this error and update the user experience accordingly.
For example, you could remove the faulty Lens from your Lens selection UI.
```ts
cameraKitSession.events.addEventListener('error', ({ detail }) => {
if (detail.error.name === 'LensExecutionError') {
console.log(`Lens ${detail.lens.name} encountered an error and was removed. Please pick a different lens.`)
}
})
```