-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lighthouse Document Upload] Refactor Lighthouse error response handl…
…ing (#19623) * Refactor Lighthouse document upload error handling Refactors the LighthouseSupplementalDocumentUploadProvider to catch any exception raised during the upload process and ensure they are logged properly. This includes those custom exceptions raised in the Lighthouse::ServiceException class via our Lighthouse API client. Prior to this change, an exception raised elsewhere, including the service exceptions, would have prevented the code that handles a Lighthouse response in this provider from properly logging an upload failure because the code would raise instead of continuing to execute * Handle exception class returning object Lighthouse::ServiceException can either raise an error or return an error object so we need to account for both cases when we use this class to handle errors from the Lighthouse upload response * Remove invalid 200 response handling Instead of logging an upload as a failure, if we recieve a 200 response from Lighthouse but the metadata doesn't match what we expect, we want to fail loudly so we can address the mismatch instead of simply logging an upload failure, which is reserved for actual failed upload responses from the Lighthouse API * Complete renaming of request id key in logs for clarity * Remove non-200 response Lighthouse handling tests We are no longer expecting to handle non-200 responses from Lighthouse within the LighthouseSupplementalDocumentUploadProvider, since these responses are passed to the Lighthouse::ServiceException class, which logs and re-raises the exception, so it will never get to the code this tested * Remove unused validate_upload_document method from doc upload providers This method was intended to be used by our document upload providers to validate veteran uploaded evidence, but we are actually checking this validation and raising an expection in the SubmitUploads job before we even use the provider, so this is now unecessary dead code * Fix linting errors * Fix upload service spec to reflect exception handling changes * Refactor Submit0781 failure tests for new exception handling * Update BDD upload spec for new logging paradigm * Update submit uploads tests for new logging paradigm * Revert "Remove unused validate_upload_document method from doc upload providers" This reverts commit 130d26c. * Refactor provider spec to match more realistic specs implemented in upload jobs
- Loading branch information
Showing
7 changed files
with
152 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.