1 | <?php |
||
23 | class ErrorPlugin implements Plugin |
||
24 | { |
||
25 | /** |
||
26 | * @var string[] |
||
27 | */ |
||
28 | private static $errors = [ |
||
29 | 'ERROR' => ServerErrorException::class, |
||
30 | 'INVALID_REQUEST' => ClientErrorException::class, |
||
31 | 'MAX_DIMENSIONS_EXCEEDED' => ClientErrorException::class, |
||
32 | 'MAX_ELEMENTS_EXCEEDED' => ClientErrorException::class, |
||
33 | 'MAX_WAYPOINTS_EXCEEDED' => ClientErrorException::class, |
||
34 | 'NOT_FOUND' => ClientErrorException::class, |
||
35 | 'OVER_QUERY_LIMIT' => ServerErrorException::class, |
||
36 | 'REQUEST_DENIED' => ClientErrorException::class, |
||
37 | 'UNKNOWN_ERROR' => ServerErrorException::class, |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * @var string[] |
||
42 | */ |
||
43 | private static $placeholders = [ |
||
44 | '"status" : "%s"', |
||
45 | '<status>%s</status>', |
||
46 | ]; |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function handleRequest(RequestInterface $request, callable $next, callable $first) |
||
67 | } |
||
68 |