I use search_api_solr with a server-based Solr installation. Works fine. For reasons I won't explain, the Solr service is stopped sometimes. If a user does a search while Solr is stopped, they crash with "The website encountered an unexpected error."
The error log says "Drupal\search_api_solr\SearchApiSolrException: An error occurred while trying to search with Solr: Solr endpoint http://localhost:8983/ unreachable or returned unexpected response code "0"." No surprise, since the service is stopped.
How can I trap this error and display a "Search isn't working" page instead of crashing? Seems like there should be a way to intercept it, but I haven't figured it out.