-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PP-11682 Update axios client with validateStatus config
- Updated the Axios config so that the `validateStatus` option can be toggled. - Default - everything that is not 2xx will throw an exception. - E.g. 404 will throw an exception. - Now added the `acceptAllStatusCodes` option: - If this is set to `true` then all status codes are considered a succes and won't throw an exception. - E.g. 404 will NOT throw an exception. - Updated the retry behaviour when a `get` request and the error returned is `ECONNRESET`: - When acceptAllStatusCodes=false - Will retry 3 times and call the failure callback method - When acceptAllStatusCodes=true - Will retry 3 times and call the success callback method - Pass reason and message in errorContext - Bump version to v6 Co-authored-by: Iqbal Ahmed <iqbal.ahmed@digital.cabinet-office.gov.uk> Co-authored-by: Hugo Jeffreys <hugo.jeffreys@digital.cabinet-office.gov.uk> Co-authored-by: Marco Tranchino <marco.tranchino@digital.cabinet-office.gov.uk>
- Loading branch information
1 parent
f4e17f3
commit 80576aa
Showing
4 changed files
with
522 additions
and
66 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.