Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | public function onKernelException(GetResponseForExceptionEvent $event) |
||
31 | { |
||
32 | $exception = $event->getException(); |
||
33 | |||
34 | if (!$exception instanceof BadJsonRequestException) { |
||
35 | return null; |
||
36 | } |
||
37 | |||
38 | $event->setResponse(new JsonResponse(['errors' => $exception->getErrors()], 400)); |
||
39 | } |
||
40 | } |
||
41 |