diff --git a/app/controllers/concerns/hyrax/homepage_controller_behavior.rb b/app/controllers/concerns/hyrax/homepage_controller_behavior.rb index d31a2d97e1..3323a4f09f 100644 --- a/app/controllers/concerns/hyrax/homepage_controller_behavior.rb +++ b/app/controllers/concerns/hyrax/homepage_controller_behavior.rb @@ -35,14 +35,14 @@ def fetch_admin_sets .rows(5) response = repository.search(builder) response.documents - rescue Blacklight::Exceptions::ECONNREFUSED + rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest [] end def recent # grab any recent documents (_, @recent_documents) = search_results(q: '', sort: sort_field, rows: 4) - rescue Blacklight::Exceptions::ECONNREFUSED + rescue Blacklight::Exceptions::ECONNREFUSED, Blacklight::Exceptions::InvalidRequest @recent_documents = [] end diff --git a/spec/controllers/hyrax/homepage_controller_spec.rb b/spec/controllers/hyrax/homepage_controller_spec.rb index 2ff4f9b32d..7770813b40 100644 --- a/spec/controllers/hyrax/homepage_controller_spec.rb +++ b/spec/controllers/hyrax/homepage_controller_spec.rb @@ -130,7 +130,7 @@ context "without solr" do before do allow(controller).to receive(:repository).and_return(instance_double(Blacklight::Solr::Repository)) - allow(controller.repository).to receive(:search).and_raise Blacklight::Exceptions::ECONNREFUSED + allow(controller.repository).to receive(:search).and_raise Blacklight::Exceptions::InvalidRequest end it "errors gracefully" do