From 45aa8541169f8db8dd573c6b20ba40482a7575d6 Mon Sep 17 00:00:00 2001 From: Justin Littman Date: Mon, 14 Aug 2023 15:56:28 -0400 Subject: [PATCH] Removes catkey from objects controller error message. closes #4550 --- app/controllers/objects_controller.rb | 2 +- spec/requests/create_object_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/objects_controller.rb b/app/controllers/objects_controller.rb index 437ad59d5..1cf1e9c02 100644 --- a/app/controllers/objects_controller.rb +++ b/app/controllers/objects_controller.rb @@ -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) diff --git a/spec/requests/create_object_spec.rb b/spec/requests/create_object_spec.rb index 1e544ebd3..7cf963586 100644 --- a/spec/requests/create_object_spec.rb +++ b/spec/requests/create_object_spec.rb @@ -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