Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
OrchestratorException
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getRequest
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * WikiLambda OrchestratorException
4 *
5 * Wraps any network transport-related exceptions throwhn by the OrchestratorRequest guzzle request.
6 *
7 * @file
8 * @ingroup Extensions
9 * @copyright 2020– Abstract Wikipedia team; see AUTHORS.txt
10 * @license MIT
11 */
12
13namespace MediaWiki\Extension\WikiLambda;
14
15use Exception;
16use Throwable;
17
18class OrchestratorException extends Exception {
19
20    /**
21     * @param string $message
22     * @param array $request
23     * @param ?int $code
24     * @param ?Throwable $previous
25     */
26    public function __construct(
27        string $message,
28        private readonly array $request = [],
29        ?int $code = 0,
30        ?Throwable $previous = null
31    ) {
32        parent::__construct( $message, $code ?? 0, $previous );
33    }
34
35    /**
36     * @return array
37     */
38    public function getRequest(): array {
39        return $this->request;
40    }
41}