From 5c7f2f17f9c471d306955df457c7cab4e5c6ed3b Mon Sep 17 00:00:00 2001 From: Snap Date: Thu, 16 Apr 2015 14:51:26 -0700 Subject: Google's OpenID Connect method $google_client_id & $google_client_secret must be added to db.inc.php! --- .../src/Google/Service/Exception.php | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 includes/google-api-php-client-master/src/Google/Service/Exception.php (limited to 'includes/google-api-php-client-master/src/Google/Service/Exception.php') diff --git a/includes/google-api-php-client-master/src/Google/Service/Exception.php b/includes/google-api-php-client-master/src/Google/Service/Exception.php new file mode 100644 index 0000000..65c945b --- /dev/null +++ b/includes/google-api-php-client-master/src/Google/Service/Exception.php @@ -0,0 +1,105 @@ += 0) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + + $this->errors = $errors; + + if (is_array($retryMap)) { + $this->retryMap = $retryMap; + } + } + + /** + * An example of the possible errors returned. + * + * { + * "domain": "global", + * "reason": "authError", + * "message": "Invalid Credentials", + * "locationType": "header", + * "location": "Authorization", + * } + * + * @return [{string, string}] List of errors return in an HTTP response or []. + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Gets the number of times the associated task can be retried. + * + * NOTE: -1 is returned if the task can be retried indefinitely + * + * @return integer + */ + public function allowedRetries() + { + if (isset($this->retryMap[$this->code])) { + return $this->retryMap[$this->code]; + } + + $errors = $this->getErrors(); + + if (!empty($errors) && isset($errors[0]['reason']) && + isset($this->retryMap[$errors[0]['reason']])) { + return $this->retryMap[$errors[0]['reason']]; + } + + return 0; + } +} -- cgit v1.2.3