GPCsolutions / zenfusionoauth

A Google APIs OAuth 2 client for ZenFusion & Dolibarr
https://www.dolistore.com/en/modules/313-ZenFusion-OAuth-for-Google.html
GNU General Public License v3.0
0 stars 1 forks source link

Better error handling #27

Open rdoursenaud opened 9 years ago

rdoursenaud commented 9 years ago

Errors should be properly catched.

Here's an exemple a client got faced with : Fatal error: Uncaught exception 'Google_Auth_Exception' with message 'Error refreshing the OAuth2 token, message: '{ "error" : "invalid_client", "error_description" : "The OAuth client was deleted." }'' in /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/google-api-php-client/src/Google/Auth/OAuth2.php:327 Stack trace: #0 /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/google-api-php-client/src/Google/Auth/OAuth2.php(254): Google_Auth_OAuth2->refreshTokenRequest(Array) #1 /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/google-api-php-client/src/Google/Client.php(364): Google_Auth_OAuth2->refreshToken('1/DGtyBK9SIFEqw...') #2 /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/tokens.lib.php(123): Google_Client->refreshToken('1/DGtyBK9SIFEqw...') #3 /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/tokens.lib.php(96): refreshTokenIfExpired(Object(stdClass)) #4 /home/doozo/www/dolibarr/htdocs/custom/zenfusiondrive/class/actions_zenfusiondrive.class.php(57): getToken(Object(Doli in /home/doozo/www/dolibarr/htdocs/custom/zenfusionoauth/lib/google-api-php-client/src/Google/Auth/OAuth2.php on line 327

rdoursenaud commented 8 years ago

Now in class/Token.class.php.