| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The base class for all API call exceptions. |
| 5 |
*/ |
| 6 |
class Dropbox_Exception extends Exception |
| 7 |
{ |
| 8 |
public $previousException; |
| 9 |
|
| 10 |
/** |
| 11 |
* @internal |
| 12 |
*/ |
| 13 |
public function __construct($message, $cause = null) |
| 14 |
{ |
| 15 |
if (version_compare(PHP_VERSION, '5.3', '<')) { |
| 16 |
$this->previousException = $cause; |
| 17 |
parent::__construct($message, 0); |
| 18 |
|
| 19 |
return; |
| 20 |
} |
| 21 |
parent::__construct($message, 0, $cause); |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* @return mixed |
| 26 |
*/ |
| 27 |
public function getPreviousException() |
| 28 |
{ |
| 29 |
return $this->previousException; |
| 30 |
} |
| 31 |
} |
| 32 |
|