This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Add extra error classes to handle server errors. #1
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.
In order to provide more granularity on the exceptions, we are adding some additional error classes for the common Server errors.
Motivation
json_api_client
doesn't give us enough granularity on the exceptions. Adding some additional clauses for the common ones like 502, 503, 504, 429 in here (e.g. JsonApiClient::GatewayTimeoutError) and then adding them into CarwowCore::Retryable in here to retry on before we start raising to bugsnag/counting as failures on HC would be good way to reduce the noise on both platform.e.g. https://app.bugsnag.com/carwow/dealers-site/errors/6065a65c547bc400077c0f54?event_id=606c65b000773cede9540000&i=pd&m=eu
and
https://app.bugsnag.com/carwow/dealers-site/errors/6065a65c547bc400077c0f54?event_id=606f05a1007737366dfe0000&i=pd&m=eu
See the whole conversation: https://carwow.slack.com/archives/C011H6KGV8S/p1617892756054600
https://carwow.kanbanize.com/ctrl_board/36/cards/32474/