Skip to content

Conversation

vincent-pochet
Copy link
Collaborator

Context

Sometime jobs to fetch taxes from Anrock are failing with a JSON::ParseError. It happens because the server is responding with an HTTP 200 even if the message contains the HTML markup for an HTTP 502 Bad Gateway...

Description

This PR adds some logic to detect the presence of the error in the response body and re-reraise the right error for a correct handling, in this case an auto-retry of job

@vincent-pochet vincent-pochet merged commit 0c1404b into main Feb 21, 2025
6 checks passed
@vincent-pochet vincent-pochet deleted the misc-tax-502-handling branch February 21, 2025 10:30
vincent-pochet added a commit that referenced this pull request Jul 3, 2025
## Description

This PR adds auto-retry logic for the
`Wallets::RefreshOngoingBalanceJob` for two errors happening with anrock
integration:
- `Net::ReadTimeout`
- `Integrations::Aggregator::BadGatewayError`

The new `Integrations::Aggregator::BadGatewayError` directly inherit
from `LagoHttpClient::HttpError` to make sure we are not breaking logic
already in place around this error type
(#3234 for example)
diegocharles pushed a commit that referenced this pull request Jul 11, 2025
## Description

This PR adds auto-retry logic for the
`Wallets::RefreshOngoingBalanceJob` for two errors happening with anrock
integration:
- `Net::ReadTimeout`
- `Integrations::Aggregator::BadGatewayError`

The new `Integrations::Aggregator::BadGatewayError` directly inherit
from `LagoHttpClient::HttpError` to make sure we are not breaking logic
already in place around this error type
(#3234 for example)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants