Completed
Push — master ( f3d222...548fd9 )
by Agaletskiy
01:48
created

OmsGeneralErrorException::becauseOfError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lamoda\OmsClient\Exception;
6
7
final class OmsGeneralErrorException extends \RuntimeException implements OmsClientExceptionInterface
8
{
9
    public static function becauseOfError(\Throwable $exception): self
10
    {
11
        return new static(sprintf(
12
            'Request to OMS finished with error "%s"',
13
            $exception->getMessage()
14
        ), 0, $exception);
15
    }
16
}