Open file lib\blacklight\catalog.rb
. The function rsolr_request_error(exception)
is responsible to handle Solr errors. The exception
parameter is an RSolr::RequestError
and it represents the error from Solr. In order to handle the error by displaying the message from Solr just add the following inside the else
:
error_status = eval(exception.response[:body])['error']
if !error_status.nil? and !error_status['msg'].nil?
flash_notice = error_status['msg']
else
flash_notice = I18n.t('blacklight.search.errors.request_error')
end
If you wish to display a different message then assign a different message to flash_notice
. If you wish to handle the error differently then this is where to do so.