-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Direct deposit update #12812
Direct deposit update #12812
Conversation
Generated by 🚫 Danger |
@@ -73,7 +73,12 @@ def self.get_errors_from_response(error, error_status = nil) | |||
def self.error_object_details(error_body, error_status) | |||
status = error_status&.to_s | |||
title = error_body['title'] || error_class(status.to_sym).to_s | |||
detail = error_body['detail'] || error_body['message'] || error_body['error'] || 'No details provided' | |||
detail = error_body['detail'] || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahay-agile6 Just FYI - I added a check for error_description
.
* Add update function to direct deposit service and standardize error responses * Linting fixes --------- Co-authored-by: Jeremy Weiland <jeremy6d@users.noreply.github.com>
Summary
The core changes are around the
Lighthouse::DirectDeposit::Service.update_payment_info
method. Any requests to the Lighthouse Direct Deposit API that result in a 400-599 range will throw an exception.Exceptions will be handled using the
Lighthouse::ServiceException
class. This class that was made to be a generic exception handler for error objects and requests that come from the Lighthouse API endpoints, taking into account the currently known different "styles" of errors that may come.The
V0::Profile::DirectDeposits::DisabilityCompensationsController
uses arescue_from
from block to standardize error responses from the Lighthouse Direct Deposit API and provide an error code that the front end can use more easily.Testing done
More specs will be added in subsequent PRs.