googleapis / gax-php

Google API Extensions for PHP
http://googleapis.github.io/gax-php/
BSD 3-Clause "New" or "Revised" License
235 stars 51 forks source link

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

Open lezhnev74 opened 4 years ago

lezhnev74 commented 4 years ago

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:

What type I should use?

dwsupplee commented 4 years ago

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?