| 1 |
<?php |
| 2 |
|
| 3 |
namespace Wikimedia\RequestTimeout; |
| 4 |
|
| 5 |
use Wikimedia\NormalizedException\NormalizedException; |
| 6 |
|
| 7 |
/** |
| 8 |
* The base class for timeout exceptions thrown by this library |
| 9 |
*/ |
| 10 |
class TimeoutException extends NormalizedException { |
| 11 |
/** @var float */ |
| 12 |
private $limit; |
| 13 |
|
| 14 |
public function __construct( $message, $limit ) { |
| 15 |
parent::__construct( $message, [ 'limit' => $limit ] ); |
| 16 |
$this->limit = $limit; |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Get the limit which was exceeded, in seconds. |
| 21 |
* |
| 22 |
* @return float |
| 23 |
*/ |
| 24 |
public function getLimit() { |
| 25 |
return $this->limit; |
| 26 |
} |
| 27 |
} |