Details
-
Improvement
-
Resolution: Fixed
-
Neutral
-
2.1.1
-
None
Description
I was wondering if it possible to improve the error handling of the Magnolia Solr Module. Specifically: in our code we want to be able to catch SolrServerExceptions when they are thrown so we can take appropriate action (like showing an error message to the user and setting our application's health check to fail). Instead these exceptions are now caught by FacetedSolrSearchProvider#performFacettedSearch giving us no chance to do anything with them..
try { log.debug("solrQuery: " + solrQuery); response = getMagnoliaSolrBridge().getSolrServer().query(solrQuery); } catch (SolrServerException e) { log.error(e.getMessage(), e); }
I would suggest that this method and all methods that use them simply throw SolrServerExceptions so clients of the Magnolia Solr Module can take appropriate action. And by default I would suggest that the FacetedSearchResultModel#execute method catches them and returns an 'ERROR' status code in case they happen instead of an empty string that it does currently (no matter what happens).