I'm using the Google Analytics API and am getting refresh tokens as explained in the documentation. I am however facing an error if a user has revoked access from their Google account but still tries to use my integration (which is actually a possibility). When I call:
$client->setAccessToken($newtoken);
To get a new token using the refresh token a fatal error is thrown and I cannot catch this error.
Ideally I would like to check the user's refresh token access, however I can't work out how to do this, is this possible with the php library?