How to catch errors

Is there a way to catch errors, specially for the sortby, other refinements doesn’t seem to throw errors when you mistype, but also doesn’t return any errors? Since it stops the code, and if you have a loading animation the loading keeps showing and doesn’t stop, so you want to stop the loading and show a custom message instead.

The error event doesn’t seem to cover this.

Example when a wrong url is typed, or something can’t be found (typo in url):
https://rrz1pyz83n.codesandbox.io/?sortBy=instantt_search_price_asc (gives error, and doesn’t go into any function)

https://rrz1pyz83n.codesandbox.io/?refinementtList[brrand][0]=HP (no error, keeps going)

Hi @tsmits,

At the moment you cannot prevent or catch this error. If the URL is mistyped or the index does not match the one provided an error is thrown. The only way to workaround this at the moment is to create a widget from scratch (without the connectors). You can find more information about that in the doc.

I’ve opened an issue about that on GitHub.