Completed
Push — master ( 62715e...b78644 )
by KwangSeob
02:01
created

JiraException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 4
dl 0
loc 5
rs 10
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: keanor
5
 * Date: 14.08.15
6
 * Time: 20:53.
7
 */
8
9
namespace JiraRestApi;
10
11
/**
12
 * Class JiraException.
13
 */
14
class JiraException extends \Exception
15
{
16
    /**
17
     * Response returned by Jira.
18
     *
19
     * @var string|null
20
     */
21
    protected $response;
22
23
    /**
24
     * Create a new Jira exception instance.
25
     *
26
     * @param  string  $message
27
     * @param  int  $code
28
     * @param  \Throwable  $previous
29
     * @param  string  $response
30
     * @return void
31
     */
32
    public function __construct($message = null, $code = 0, \Throwable $previous = null, $response = null)
33
    {
34
        parent::__construct($message, $code, $previous);
35
36
        $this->response = $response;
37
    }
38
39
    /**
40
     * Get error response.
41
     *
42
     * @return string|null
43
     */
44
    public function getResponse()
45
    {
46
        return $this->response;
47
    }
48
}
49