Handle failed request to system supplementary #2611
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://eaflood.atlassian.net/browse/WATER-4622
We recently added support for sending a request to the water-abstraction-system to let it know a new charge version had been added. The intent is for water-abstraction-system to determine if the licence needs to be flagged for SROC two-part tariff supplementary billing because of this.
The only problem is we ain't built the endpoint yet! 🤦
We've just realised we've broken the create charge version journey because the request is getting a failed response (404). We're not far away from adding the endpoint. But even so, we don't want a failure to flag the licence to cause the charge version record to get messed up.
This change adds a
try/catch
around the request so we can log and swallow any failures and let the legacy code continue doing its job.