-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only log essential info on failed requests (#139)
https://eaflood.atlassian.net/browse/WATER-3906 When working on the [Spike - Create a complete debit only SROC bill run](#133) a request to the [sroc-charging-module-api](https://github.com/DEFRA/sroc-charging-module-api) failed, as in we got a `4xx/5xx` response. One of the things that made it hard to track down the cause as we are currently dumping the full response object [Got](https://github.com/sindresorhus/got) returns into the log. Should **Got** throw an exception, for example, when a network error occurs we'll want to see everything. But if the request fails because the Charging Module has returned an error response, we just want to see that information. So, this tweaks the logging in `RequestLib` to ensure this. --- We also took advantage of making these changes to do some boy scout cleanup and remove the duplication across the `get()` and `post()` methods. Co-authored-by: Jason Claxton <30830544+Jozzey@users.noreply.github.com>
- Loading branch information
1 parent
a1e22b0
commit 38e2e37
Showing
2 changed files
with
84 additions
and
41 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