Skip to content

Commit f60dbcd

Browse files
committed
Fix exception type for onRefreshError
1 parent db3d6db commit f60dbcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GuzzleMiddleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function setOnRefreshEnd(callable $callback): void
118118
* Set a callback that will react to a refresh token error.
119119
*
120120
* @param callable $callback
121-
* A callback which accepts one argument, the BadResponseException, and
121+
* A callback which accepts one argument, the IdentityProviderException, and
122122
* returns an AccessToken or null.
123123
*/
124124
public function setOnRefreshError(callable $callback): void
@@ -224,7 +224,7 @@ private function acquireAccessToken(): AccessToken
224224
return $this->provider->getAccessToken(new RefreshToken(), [
225225
'refresh_token' => $this->accessToken->getRefreshToken(),
226226
]);
227-
} catch (BadResponseException $e) {
227+
} catch (IdentityProviderException $e) {
228228
if (isset($this->onRefreshError)) {
229229
$accessToken = call_user_func($this->onRefreshError, $e);
230230
if ($accessToken) {

0 commit comments

Comments
 (0)