From 088b510edfbcf73456fcc0d2bbe7309bc9d00913 Mon Sep 17 00:00:00 2001 From: krish palaniappan Date: Fri, 4 Aug 2017 17:17:05 -0400 Subject: [PATCH] Resolved: - 9821: RIDP: /verify_identity fields missing should generate a specific error --- lib/api/v1/mobile/renderer/base_renderer.rb | 2 +- lib/api/v1/mobile/renderer/ridp_renderer.rb | 2 +- lib/api/v1/mobile/ridp/ridp_verification.rb | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/api/v1/mobile/renderer/base_renderer.rb b/lib/api/v1/mobile/renderer/base_renderer.rb index bd9efd17cab..c74b833b7cd 100644 --- a/lib/api/v1/mobile/renderer/base_renderer.rb +++ b/lib/api/v1/mobile/renderer/base_renderer.rb @@ -27,7 +27,7 @@ def execute proc, controller, error=nil # Show more error details in the lower environments. def env_specific_error e, error=nil - ([:development, :test].include? Rails.env.to_sym) ? [e.message, error].compact + e.backtrace : e.message + ([:development, :test].include? Rails.env.to_sym) ? [e.message, error].compact + e.backtrace : error || e.message end end diff --git a/lib/api/v1/mobile/renderer/ridp_renderer.rb b/lib/api/v1/mobile/renderer/ridp_renderer.rb index 8c39124ec8c..1cba83f5193 100644 --- a/lib/api/v1/mobile/renderer/ridp_renderer.rb +++ b/lib/api/v1/mobile/renderer/ridp_renderer.rb @@ -5,7 +5,7 @@ module RidpRenderer include BaseRenderer extend Api::V1::Mobile::Util::UrlUtil MESSAGE_SUFFIX = "not received or could not be processed" - IDENTITY_VERIFICATION_QUESTIONS_ERROR = "valid identity verification questions were #{MESSAGE_SUFFIX}" + IDENTITY_VERIFICATION_QUESTIONS_ERROR = "Invalid JSON or valid identity verification questions were #{MESSAGE_SUFFIX}" IDENTITY_VERIFICATION_ANSWERS_ERROR = "valid identity verification response was #{MESSAGE_SUFFIX}" def render_questions session, request, controller diff --git a/lib/api/v1/mobile/ridp/ridp_verification.rb b/lib/api/v1/mobile/ridp/ridp_verification.rb index b20107b24cd..c6ae0ef8e81 100644 --- a/lib/api/v1/mobile/ridp/ridp_verification.rb +++ b/lib/api/v1/mobile/ridp/ridp_verification.rb @@ -15,7 +15,9 @@ def build_question_response } end #lambda - _verification_service_instance.initiate_session create_request_payload.call + response = _verification_service_instance.initiate_session create_request_payload.call + response = {error: 'No response received from RIDP. Check the request JSON.'} unless response + response end #