Skip to content

Commit

Permalink
Merge pull request #921 from projecthydra-labs/rsolr-stub
Browse files Browse the repository at this point in the history
Update RSolr exception class stubbing for rsolr 2.0
  • Loading branch information
mjgiarlo committed May 10, 2017
2 parents 8283950 + f65fe78 commit 89ef2ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/hyrax/homepage_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 89ef2ef

Please sign in to comment.