Skip to main content

Error Handling

Ignore unknown features​

You can pass the attribute ignore-unknown-features to the viewer, in order to avoid the viewer passing fallbacks and handling errors. This is recommended for production builds as it will not block the UI for the user.

info

This only works on features that are unknown and not options. Given the features FINISH: "BLACK POWER COATED ALUMINIUM", the attribute will work only if FINISH is invalid, but not if its value "BLACK POWER COATED ALUMINIUM" is invalid.

Default behaviour​

The viewer will try to resolve errors by graceful fallbacks. If a product is found, but the features are not available, the viewer will render the default product configuration.

It will also write a warning to the console and set the error property on the viewer to the latest error.

Custom fallback​

If you want to provide a custom fallback, you can use the fallback slot. This slot will be shown if the viewer fails to load or find any graceful fallback on its own. A fallback event will be fired at the same moment the content is displayed.

<cylindo-viewer>
<div slot="fallback">
<h2>Product could not be found!</h2>
<img src="https://via.placeholder.com/720x540" />
</div>
</cylindo-viewer>

Product could not be found!