Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | class ConnectionFailedException extends RuntimeException implements AppBundleExceptionInterface |
||
28 | { |
||
29 | /** |
||
30 | * Default error message |
||
31 | * |
||
32 | * @const string |
||
33 | */ |
||
34 | public const MESSAGE = 'Connection to message broker is failed.'; |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public function __construct( |
||
40 | string $message = self::MESSAGE, |
||
41 | int $code = Response::HTTP_INTERNAL_SERVER_ERROR, |
||
42 | Throwable $previous = null |
||
43 | ) { |
||
44 | parent::__construct($message, $code, $previous); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Returns exception with previous one |
||
49 | * |
||
50 | * @param Exception $previous Previous exception |
||
51 | * |
||
52 | * @return ConnectionFailedException |
||
53 | */ |
||
54 | public static function withPrevious(Exception $previous): ConnectionFailedException |
||
57 | } |
||
58 | } |
||
59 |