Handling rendering exceptions in Coveo components (web forms)
We frequently get yellow screens of death which are coming from Coveo components (such as CoveoSearchBox).
I want these components to fall over gracefully if for whatever reason Coveo isn't working so that the site still functions, even if the search isn't working.
I'm used to Sitecore MVC where we'd normally just add exception handling as a pipeline, but it seems you can't do that with WebForms.
I have tried to create a copy of the User Controls and catch exceptions thrown in the RenderControl. This does prevent a yellow screen, but it results in half of the markup being sent in the response writer breaking the page on the front end.
Do you have any advice on how I can easily make all of the coveo controls fail gracefully?
This version of Coveo for Sitecore have health check and component settings validation built-in the UI components. You can see it in the ascx files:
<coveoui:ErrorSummary runat="server" /> <coveoui:WhenConfigured runat="server"> ... </coveoui:WhenConfigured>
The `coveoui:WhenConfigured` will return `false` for its `Visible` property if the health check is not passing or if the component settings are invalid. This hides the components and catches the exceptions during the health check.
The health check validates that the context Sitecore search index is successfully initialized.
If the Sitecore search index is successfully initialized but the underlying Coveo index has problems after the initialization, the JS UI will handle the error by displaying the "Oops" message on the client-side.
Can you share some exception examples you encountered? Please include the context of those errors as well.