-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry after retryable error codes #664
Comments
@dmachehin This is not a feature that we currently provide. Thank you for the suggestion! |
@PierrickVoulet @fiboknacky Such a feature would be great! Is such a feature already there? Or is it in the Roadmap? I see the issue is still open, with a difficulty:hard label. Maybe documenting a working workaround would be good? A workaround is to check the message content for "Retry the request", but there are other errors that don't have a retry in the message, such as when a resource is not yet available (for example, when creating a Google Ads account and assigning a Billing profile to it). In those cases, I become a This workaround depends on the structure of the error message being always the same and always indicating if one should retry the request, which in my experience it doesn't. Here is a small snippet for the retry. private function isRetryRequestInErrorMessage(Exception $exception): bool
{
return ($exception::class === GoogleAdsException::class || $exception::class === ApiException::class) &&
str_contains($exception->getBasicMessage(), 'Retry the request') ||
str_contains($exception->getMessage(), 'Retry the request');
} That snippet does not cover the Are there any best practices for such retries that I haven't found yet? Thanks! Diego |
I'm sorry that this was off my radar. About what you suggest, it totally makes sense, although we might need to be careful about the error message since it can be easily changed, unlike the enum values themselves. |
Maybe have "use case" for automatic retries globally (all methods) for error codes LIKE
CONCURRENT_MODIFICATION
?The text was updated successfully, but these errors were encountered: