Skip to content

Commit

Permalink
Merge branch '3.x' into issuep1-1022
Browse files Browse the repository at this point in the history
  • Loading branch information
kedarkhaire authored Jan 9, 2024
2 parents dcebb26 + 60b423c commit 854e63c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/HttpClient/Plugin/Authentication/GceServiceAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
use Apigee\Edge\Client;
use Apigee\Edge\ClientInterface;
use Apigee\Edge\Exception\ApigeeOnGcpOauth2AuthenticationException;
use Http\Client\Exception;
use Http\Message\Authentication\Header;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Client\NetworkExceptionInterface;

/**
* GCE Service Account authentication plugin for authenticating to Google
Expand Down Expand Up @@ -61,7 +62,7 @@ public function isAvailable(): bool
$this->authClient()->get('');

return true;
} catch (Exception $e) {
} catch (NetworkExceptionInterface $e) {
return false;
}
}
Expand All @@ -85,7 +86,7 @@ protected function getAccessToken(): void
$response = $this->authClient()->get('');
$decoded_token = json_decode((string) $response->getBody(), true);
$this->tokenStorage->saveToken($decoded_token);
} catch (Exception $e) {
} catch (ClientExceptionInterface $e) {
throw new ApigeeOnGcpOauth2AuthenticationException($e->getMessage(), $e->getCode(), $e);
}
}
Expand Down

0 comments on commit 854e63c

Please sign in to comment.