PluginProbe
Authorizer / 2.2
Authorizer v2.2
3.15.3 3.15.2 3.15.1 3.15.0 3.14.3 3.14.4 3.14.2 3.14.1 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.10 2.9.11 2.9.12 2.9.13 2.9.2 2.9.3 2.9.6 All 126 releases
authorizer / inc / google-api-php-client / src / Google / Service / Exception.php

Exception.php in Authorizer 2.2, at inc/google-api-php-client/src/Google/Service/Exception.php

54 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 require_once 'Google/Exception.php';
4
5 class Google_Service_Exception extends Google_Exception
6 {
7 /**
8 * Optional list of errors returned in a JSON body of an HTTP error response.
9 */
10 protected $errors = array();
11
12 /**
13 * Override default constructor to add ability to set $errors.
14 *
15 * @param string $message
16 * @param int $code
17 * @param Exception|null $previous
18 * @param [{string, string}] errors List of errors returned in an HTTP
19 * response. Defaults to [].
20 */
21 public function __construct(
22 $message,
23 $code = 0,
24 Exception $previous = null,
25 $errors = array()
26 ) {
27 if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
28 parent::__construct($message, $code, $previous);
29 } else {
30 parent::__construct($message, $code);
31 }
32
33 $this->errors = $errors;
34 }
35
36 /**
37 * An example of the possible errors returned.
38 *
39 * {
40 * "domain": "global",
41 * "reason": "authError",
42 * "message": "Invalid Credentials",
43 * "locationType": "header",
44 * "location": "Authorization",
45 * }
46 *
47 * @return [{string, string}] List of errors return in an HTTP response or [].
48 */
49 public function getErrors()
50 {
51 return $this->errors;
52 }
53 }
54