Skip to content

Commit

Permalink
rescue SymphonyReader::ResponseError in controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
ndushay committed Sep 10, 2019
1 parent a01f2ef commit 2ed22af
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/marcxml_controller.rb
Expand Up @@ -3,7 +3,7 @@
class MarcxmlController < ApplicationController #:nodoc:
before_action :set_marcxml_resource

rescue_from(SymphonyReader::RecordIncompleteError) do |e|
rescue_from(SymphonyReader::ResponseError) do |e|
render status: :internal_server_error, plain: e.message
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/metadata_refresh_controller.rb
Expand Up @@ -4,7 +4,7 @@
class MetadataRefreshController < ApplicationController
before_action :load_item

rescue_from(SymphonyReader::RecordIncompleteError) do |e|
rescue_from(SymphonyReader::ResponseError) do |e|
render status: :internal_server_error, plain: e.message
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/objects_controller.rb
Expand Up @@ -19,7 +19,7 @@ class ObjectsController < ApplicationController
render status: :internal_server_error, plain: e.message
end

rescue_from(SymphonyReader::RecordIncompleteError) do |e|
rescue_from(SymphonyReader::ResponseError) do |e|
render status: :internal_server_error, plain: e.message
end

Expand Down
2 changes: 1 addition & 1 deletion spec/requests/register_object_spec.rb
Expand Up @@ -41,7 +41,7 @@
let(:errmsg) { 'my unique snowflake error message' }

before do
allow(RegistrationService).to receive(:register_object).and_raise(SymphonyReader::RecordIncompleteError.new(errmsg))
allow(RegistrationService).to receive(:register_object).and_raise(SymphonyReader::ResponseError.new(errmsg))
end

it 'returns a 500 error' do
Expand Down

0 comments on commit 2ed22af

Please sign in to comment.