Skip to content

Commit

Permalink
Merge pull request #26 from dchealthlink/error-handling
Browse files Browse the repository at this point in the history
Resolved - RIDP: /verify_identity fields missing should generate a specific error
  • Loading branch information
kpalania authored Aug 8, 2017
2 parents b106e2f + 088b510 commit fa326dc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/api/v1/mobile/renderer/base_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/api/v1/mobile/renderer/ridp_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lib/api/v1/mobile/ridp/ridp_verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
Expand Down

0 comments on commit fa326dc

Please sign in to comment.