Skip to content

Commit

Permalink
Merge pull request #4553 from sul-dlss/t4550-error_msg
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiarlo authored Aug 14, 2023
2 parents 19553cc + 45aa854 commit c93c2c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/objects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def create
Honeybadger.notify(e)
json_api_error(status: :bad_gateway, title: 'Catalog connection error', message: 'Unable to read descriptive metadata from the catalog')
rescue Catalog::MarcService::CatalogRecordNotFoundError => e
json_api_error(status: :bad_request, title: 'Catkey not found in Symphony', message: e.message)
json_api_error(status: :bad_request, title: 'Record not found in catalog', message: e.message)
rescue Catalog::MarcService::MarcServiceError => e
Honeybadger.notify(e)
json_api_error(status: :internal_server_error, message: e.message)
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/create_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
post '/v1/objects',
params: data,
headers: { 'Authorization' => "Bearer #{jwt}", 'Content-Type' => 'application/json' }
expect(response.body).to eq '{"errors":[{"status":"400","title":"Catkey not found in Symphony",' \
expect(response.body).to eq '{"errors":[{"status":"400","title":"Record not found in catalog",' \
'"detail":"unable to find catkey"}]}'
expect(response).to have_http_status :bad_request
end
Expand Down

0 comments on commit c93c2c4

Please sign in to comment.