ApiInternalCallException::getExceptionMessage()   A
last analyzed

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
/**
8
 * Class ApiInternalCallException.
9
 */
10
class ApiInternalCallException extends \RuntimeException
11
{
12
    /**
13
     * @var Response
14
     */
15
    protected $response;
16
17
    /**
18
     * @var string
19
     */
20
    protected $exceptionMessage;
21
22
    /**
23
     * @var \Exception
24
     */
25
    protected $previousException;
26
27
    /**
28
     * @param Response $response
29
     * @param string   $message
30
     */
31
    public function __construct(Response $response, $message = 'There was an error while processing your request')
32
    {
33
        $this->response = $response;
34
        $this->exceptionMessage = $message;
35
        $this->message = $message;
36
        $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...
37
    }
38
39
    /**
40
     * @return Response
41
     */
42
    public function getResponse()
43
    {
44
        return $this->response;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getExceptionMessage()
51
    {
52
        return $this->exceptionMessage;
53
    }
54
55
    /**
56
     * @return \Exception
57
     */
58
    public function getPreviousException()
59
    {
60
        return $this->previousException;
61
    }
62
}
63