Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class ZohoOAuthException extends Exception |
||
7 | { |
||
8 | |||
9 | protected $message = 'Unknown exception'; |
||
10 | |||
11 | // Exception message |
||
12 | protected $code = 0; |
||
13 | |||
14 | // Unknown |
||
15 | protected $file; |
||
16 | |||
17 | // User-defined exception code |
||
18 | protected $line; |
||
19 | |||
20 | // Source filename of exception |
||
21 | private $string; |
||
22 | |||
23 | // Source line of exception |
||
24 | private $trace; |
||
25 | |||
26 | public function __construct($message = null, $code = 0) |
||
27 | { |
||
28 | if (!$message) { |
||
29 | throw new $this('Unknown ' . get_class($this)); |
||
30 | } |
||
31 | parent::__construct($message, $code); |
||
32 | } |
||
33 | |||
34 | public function __toString() |
||
35 | { |
||
36 | return get_class($this) . " Caused by:'{$this->message}' in {$this->file}({$this->line})\n" . "{$this->getTraceAsString()}"; |
||
37 | } |
||
38 | } |