/**
  * Override default constructor to add ability to set $errors.
  *
  * @param string $message
  * @param int $code
  * @param Exception|null $previous
  * @param [{string, string}] errors List of errors returned in an HTTP
  * response.  Defaults to [].
  */
 public function __construct($message, $code = 0, Exception $previous = null, $errors = array())
 {
     if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
         parent::__construct($message, $code, $previous);
     } else {
         parent::__construct($message, $code);
     }
     $this->errors = $errors;
 }
Пример #2
0
 /**
  * Creates a new IO exception with an optional retry map.
  *
  * @param string $message
  * @param int $code
  * @param Exception|null $previous
  * @param array|null $retryMap Map of errors with retry counts.
  */
 public function __construct($message, $code = 0, Exception $previous = null, array $retryMap = null)
 {
     if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
         parent::__construct($message, $code, $previous);
     } else {
         parent::__construct($message, $code);
     }
     if (is_array($retryMap)) {
         $this->retryMap = $retryMap;
     }
 }
Пример #3
0
 /**
  * @desc renders error
  * @return string
  */
 public function __toString()
 {
     $string = '';
     $string .= $this->provider;
     $string .= '.';
     $string .= $this->scope;
     $string .= '.';
     $string .= $this->type;
     if (count($this->signature) >= $this->numOfArg) {
         $string .= '(';
         $string .= implode(",", $this->signature);
         $string .= ');';
     } else {
         $e = new Google_Exception("method signature has to few arguments (required: {$this->numOfArg} argument(s)). ");
         $e->show();
     }
     $string .= "\n";
     return $string;
 }
Пример #4
0
 /**
  * Override default constructor to add ability to set $errors.
  *
  * @param string $message
  * @param int $code
  * @param Exception|null $previous
  * @param [{string, string}] errors List of errors returned in an HTTP
  * response.  Defaults to [].
  */
 public function __construct($message, $code = 0, Exception $previous = null, $errors = array())
 {
     parent::__construct($message, $code, $previous);
     $this->errors = $errors;
 }
Пример #5
0
 /**
  * show
  * @desc throws a formatted Exception for Config Objects
  * @param mixed $object Chart Config Object
  */
 public function show($object = null)
 {
     parent::show(get_class($this), $object->getDefault());
 }