Skip to content

Commit

Permalink
Merge pull request #1909 from sul-dlss/folioclient-error
Browse files Browse the repository at this point in the history
Raise FolioClient::Error instead of FolioError
  • Loading branch information
marlo-longley authored Oct 10, 2023
2 parents 314bd46 + 83e1814 commit 091f0dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/services/folio_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def check_response(response, title:, context:)
return if response.success?

if response.status == 422 && Array(response.headers[Faraday::CONTENT_TYPE]).any? { |x| x.match?(/\bjson$/) }
raise FolioError, "#{title} request for #{context_string} was not successful", JSON.parse(response.body)
raise FolioClient::Error, "#{title} request for #{context_string} was not successful", JSON.parse(response.body)
end

context_string = context.map { |k, v| "#{k}: #{v}" }.join(', ')
Expand Down

0 comments on commit 091f0dd

Please sign in to comment.