PluginProbe
InfiniteWP Client / trunk
InfiniteWP Client vtrunk
1.13.10 1.13.7 trunk 0.1.4 0.1.5 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.11.0 1.11.1 1.12.1 1.12.3 All 92 releases
iwp-client / lib / Google / Service / Exception.php

Exception.php in InfiniteWP Client trunk, at lib/Google/Service/Exception.php

54 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 require_once $GLOBALS['iwp_mmb_plugin_dir'].'/lib/Google/Exception.php';
4
5 class IWP_google_Service_Exception extends IWP_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