Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2.0078 |
Changes | 0 |
1 | <?php |
||
15 | 2 | public function onKernelException(GetResponseForExceptionEvent $event) |
|
16 | { |
||
17 | 2 | if (\getenv('APP_ENV') === 'dev') { |
|
18 | // for dev env we need to show all exception data |
||
19 | return; |
||
20 | } |
||
21 | |||
22 | 2 | $exception = $event->getException(); |
|
23 | 2 | $response = new JsonResponse([ |
|
24 | 2 | 'error' => $exception->getMessage(), |
|
25 | ]); |
||
26 | 2 | $event->setResponse($response); |
|
27 | 2 | } |
|
28 | /** |
||
37 | } |