Completed
Push — master ( ec4c56...bd8716 )
by David
04:49
created

RequestException::getRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Http\Client\Exception;
4
5
use Psr\Http\Message\RequestInterface;
6
use Psr\Http\Client\RequestExceptionInterface as PsrRequestException;
7
8
/**
9
 * Exception for when a request failed, providing access to the failed request.
10
 *
11
 * This could be due to an invalid request, or one of the extending exceptions
12
 * for network errors or HTTP error responses.
13
 *
14
 * @author Márk Sági-Kazár <[email protected]>
15
 */
16
class RequestException extends TransferException implements PsrRequestException
17
{
18
    use RequestAwareTrait;
19
20
    /**
21
     * @param string           $message
22
     * @param RequestInterface $request
23
     * @param \Exception|null  $previous
24
     */
25 10
    public function __construct($message, RequestInterface $request, \Exception $previous = null)
26
    {
27 10
        $this->setRequest($request);
28
29 10
        parent::__construct($message, 0, $previous);
30 10
    }
31
}
32