Google_ServiceException

The BestWebSoft Google Analytics Google ServiceException class.

Defined (1)

The class is defined in the following location(s).

/google-api-php-client/api-code/Google_Client.php  
  1. class Google_ServiceException extends Google_Exception { 
  2. /** 
  3. * Optional list of errors returned in a JSON body of an HTTP error response. 
  4. */ 
  5. protected $errors = array(); 
  6.  
  7. /** 
  8. * Override default constructor to add ability to set $errors. 
  9. * @param string $message 
  10. * @param int $code 
  11. * @param Exception|null $previous 
  12. * @param [{string, string}] errors List of errors returned in an HTTP 
  13. * response. Defaults to []. 
  14. */ 
  15. public function __construct($message, $code = 0, Exception $previous = null,  
  16. $errors = array()) { 
  17. if(version_compare(PHP_VERSION, '5.3.0') >= 0) { 
  18. parent::__construct($message, $code, $previous); 
  19. } else { 
  20. parent::__construct($message, $code); 
  21.  
  22. $this->errors = $errors; 
  23.  
  24. /** 
  25. * An example of the possible errors returned. 
  26. * { 
  27. * "domain": "global",  
  28. * "reason": "authError",  
  29. * "message": "Invalid Credentials",  
  30. * "locationType": "header",  
  31. * "location": "Authorization",  
  32. * } 
  33. * @return [{string, string}] List of errors return in an HTTP response or []. 
  34. */ 
  35. public function getErrors() { 
  36. return $this->errors;