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

ApiInternalCallException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 51
ccs 0
cts 12
cp 0
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getResponse() 0 3 1
A __construct() 0 6 1
A getExceptionMessage() 0 3 1
A getPreviousException() 0 3 1
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