Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
TimeoutException
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getLimit
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Wikimedia\RequestTimeout;
4
5use Wikimedia\NormalizedException\NormalizedException;
6
7/**
8 * The base class for timeout exceptions thrown by this library
9 */
10class 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}