Skip to content

Commit a4f34a8

Browse files
authored
Merge pull request #13 from keboola/adamvyborny-CM-649-retry-on-400
Do retry on Unknown metric error
2 parents 683a8ed + 16e6646 commit a4f34a8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Google/RestApi.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ protected function decideRetry(int $retries, int $maxRetries, ?ResponseInterface
324324
return false;
325325
}
326326
if ($statusCode === 400) {
327+
if (strpos((string) $response->getBody(), 'Unknown metric') !== false) {
328+
return true;
329+
}
327330
return false;
328331
}
329332
if ($statusCode === 401 && $retries > 0) { //allow only one retry for refreshing token

0 commit comments

Comments
 (0)