Google_IO_Exception

The Google Photos & Picasa Viewer Google IO Exception class.

Defined (1)

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

/includes/api-libs/Google/IO/Exception.php  
  1. class Google_IO_Exception extends Google_Exception implements Google_Task_Retryable 
  2. /** 
  3. * @var array $retryMap Map of errors with retry counts. 
  4. */ 
  5. private $retryMap = array(); 
  6.  
  7. /** 
  8. * Creates a new IO exception with an optional retry map. 
  9. * @param string $message 
  10. * @param int $code 
  11. * @param Exception|null $previous 
  12. * @param array|null $retryMap Map of errors with retry counts. 
  13. */ 
  14. public function __construct( 
  15. $message,  
  16. $code = 0,  
  17. Exception $previous = null,  
  18. array $retryMap = null 
  19. ) { 
  20. if (version_compare(PHP_VERSION, '5.3.0') >= 0) { 
  21. parent::__construct($message, $code, $previous); 
  22. } else { 
  23. parent::__construct($message, $code); 
  24.  
  25. if (is_array($retryMap)) { 
  26. $this->retryMap = $retryMap; 
  27.  
  28. /** 
  29. * Gets the number of times the associated task can be retried. 
  30. * NOTE: -1 is returned if the task can be retried indefinitely 
  31. * @return integer 
  32. */ 
  33. public function allowedRetries() 
  34. if (isset($this->retryMap[$this->code])) { 
  35. return $this->retryMap[$this->code]; 
  36.  
  37. return 0;