From 9df5c53ba9e51045b7ff12ddbf601a685fabd2ec Mon Sep 17 00:00:00 2001 From: Karan Krishnani Date: Thu, 27 Apr 2023 11:08:03 -0400 Subject: [PATCH] =?UTF-8?q?[department-of-veterans-affairs/va-virtual-agen?= =?UTF-8?q?t#873]=20Adds=20logging=20fo=E2=80=A6=20(#12489)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [department-of-veterans-affairs/va-virtual-agent#873] Adds logging for appeals in staging * [department-of-veterans-affairs/va-virtual-agent#873] Fixes linting * [department-of-veterans-affairs/va-virtual-agent#873] More linting fixes --- .../virtual_agent/virtual_agent_appeal_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/v0/virtual_agent/virtual_agent_appeal_controller.rb b/app/controllers/v0/virtual_agent/virtual_agent_appeal_controller.rb index 2e565c4b96c..34c84446ee0 100644 --- a/app/controllers/v0/virtual_agent/virtual_agent_appeal_controller.rb +++ b/app/controllers/v0/virtual_agent/virtual_agent_appeal_controller.rb @@ -7,21 +7,21 @@ module VirtualAgent class VirtualAgentAppealController < AppealsBaseController def index if Settings.vsp_environment == 'staging' + Rails.logger.info 'Getting appeals from Lighthouse for staging environment' @user_ssan, @user_name = set_user_credentials appeals_response = get_appeal_from_lighthouse(@user_ssan, @user_name) appeals_data_array = appeals_response['data'] + Rails.logger.info "Retrieved #{appeals_data_array.count} appeals from Lighthouse for staging environment" else - begin - appeals_response = appeals_service.get_appeals(current_user) - appeals_data_array = appeals_response.body['data'] - rescue => e - return service_exception_handler(e) - end + appeals_response = appeals_service.get_appeals(current_user) + appeals_data_array = appeals_response.body['data'] end data = data_for_first_comp_appeal(appeals_data_array) render json: { data: } + rescue => e + service_exception_handler(e) end def get_appeal_from_lighthouse(ssan, user_name)