I'm not sure how the structure of Google's API is, and I'm not a real fluent PHP programmer, but you're catching a specific exception type of Exception
, with which Google's Google_Auth_Exception
may not inherit from.
Therefore, since your try-catch block is looking for an exception that is a member of Exception
and the Google_Auth_Exception
is perhaps not a member of Exception
, then your try catch block will miss it.
Try catching the specific exception. This has happened to me before in many different languages.
Edit
The link you posted inherits its exception from: Google/Auth/Exception
Google/Auth/Exception inherits its exception from: Google/Exception
Google/Exception extends Exception
, which may, in this context be the Exception
that your class is referring to.
It seems my justification for your try-catch block not catching an exception is completely wrong, but the wisdom could still be true. Try catching the specific exception, then use instanceof
to see if PHP recognizes Google_Auth_Exception
as a member of Exception
.