-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Description
This is the first time that I get to see it but the API just thrown a html-shaped 520 error.
Return webpage title was : api.hubapi.com | 520: Web server is returning an unknown error
This error is not handled by the /hubspot/api-client/lib/RetryMiddlewareFactory.php
public static function createInternalErrorsMiddleware(
?callable $delayFunction = null,
int $maxRetries = 5
) {
return static::createMiddlewareByHttpCodeRange(500, 504, $delayFunction, $maxRetries);
}Solution : change the handled HTTP Error codes to the following ranges : 500-503 and 520-599.
Two proposed changes :
- 504 is removed from the list to allow for a retry in case of server failure.
- range 520-599 is added in order to allow for new codes like the 525 Cloudflare one.
Range 505-511 would still be considered as an exception without retry.
Metadata
Metadata
Assignees
Labels
No labels