Failed Conditions
Pull Request — release/3.0.0-dev (#32)
by Yo
01:57
created

JsonRpcInternalErrorException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
namespace Yoanm\JsonRpcServer\Domain\Exception;
3
4
/**
5
 * Class JsonRpcInternalErrorException
6
 */
7
class JsonRpcInternalErrorException extends JsonRpcException
8
{
9
    const CODE = -32603;
10
11
    const DATA_PREVIOUS_KEY = 'previous';
12
13
    /**
14
     * @param \Exception|null $previousException
15
     */
16 2
    public function __construct(\Exception $previousException = null)
17
    {
18 2
        parent::__construct(
19 2
            self::CODE,
20 2
            'Internal error',
21 2
            $previousException ? [self::DATA_PREVIOUS_KEY => $previousException->getMessage()] : []
22
        );
23 2
    }
24
}
25