Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
14 | public function onKernelException(GetResponseForExceptionEvent $event) |
||
15 | { |
||
16 | $exception = $event->getException(); |
||
17 | |||
18 | if ($exception instanceof AuthenticationException) { |
||
19 | $response = new JsonResponse([ |
||
20 | 'code' => $exception->getPrevious()->getCode(), |
||
21 | 'message' => $exception->getMessage(), |
||
22 | ], 403); |
||
23 | $event->setResponse($response); |
||
24 | } |
||
25 | } |
||
26 | } |
||
27 |