Skip to content
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

Which value to use for denoting error code in "RetrySettings"? #263

Open
lezhnev74 opened this issue May 29, 2020 · 1 comment
Open

Which value to use for denoting error code in "RetrySettings"? #263

lezhnev74 opened this issue May 29, 2020 · 1 comment
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@lezhnev74
Copy link

lezhnev74 commented May 29, 2020

Hello! I am trying to use the built-in feature of retrying API requests as explained in here: src/RetrySettings.php. However it is not clear what value to pass in retryableCodes.

There are two options:

  • pass the string value of \Google\ApiCore\ApiStatus constants like ApiStatus::DEADLINE_EXCEEDED

    • this variant described in the comments here: RetrySettings.php
  • pass the integer value of \Google\Rpc\Code constants like Code::DEADLINE_EXCEEDED

What type I should use?

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label May 29, 2020
@miraleung miraleung assigned miraleung and dwsupplee and unassigned miraleung Jun 1, 2020
@jdpedrie jdpedrie added type: question Request for information or clarification. Not an issue. and removed triage me I really want to be triaged. labels Jun 2, 2020
@dwsupplee
Copy link
Contributor

Hey there @lezhnev74 - this is a great question. You'll want to use the constants with string values (ApiStatus::DEADLINE_EXCEEDED), as that is what is keyed in to being used by the RetryMiddleware.

I can definitely see where the confusion came about due to the tests and the annotated return type on RetrySettings::getRetryableCodes.

@jdpedrie would you have a few cycles to help update the return type/tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

5 participants