Completed
Push — master ( 6c31ac...0f1d0f )
by Mads
05:55
created

ApiInternalCallException::getPreviousException()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Napp\Core\Api\Exceptions\Exceptions;
4
5
use Symfony\Component\HttpFoundation\Response;
6
7
class ApiInternalCallException extends \RuntimeException
8
{
9
    /**
10
     * @var Response
11
     */
12
    protected $response;
13
14
    /**
15
     * @var string
16
     */
17
    protected $exceptionMessage;
18
19
    /**
20
     * @var \Exception
21
     */
22
    protected $previousException;
23
24
    /**
25
     * @param Response $response
26
     * @param string $message
27
     */
28
    public function __construct(Response $response, $message = 'There was an error while processing your request')
29
    {
30
        $this->response = $response;
31
        $this->exceptionMessage = $message;
32
        $this->message = $message;
33
        $this->previousException = $response->exception;
0 ignored issues
show
Bug introduced by
The property exception does not seem to exist on Symfony\Component\HttpFoundation\Response.
Loading history...
34
    }
35
36
    /**
37
     * @return Response
38
     */
39
    public function getResponse()
40
    {
41
        return $this->response;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getExceptionMessage()
48
    {
49
        return $this->exceptionMessage;
50
    }
51
52
    /**
53
     * @return \Exception
54
     */
55
    public function getPreviousException()
56
    {
57
        return $this->previousException;
58
    }
59
}
60
61