Conditions | 3 |
Paths | 4 |
Total Lines | 29 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function onExceptionAction( |
||
13 | FlattenException $exception, |
||
14 | DebugLoggerInterface $logger = null |
||
|
|||
15 | ) { |
||
16 | /** @var Translator $translator */ |
||
17 | $translator = $this->get('translator'); |
||
18 | $message = $translator->trans('error.messages.generic'); |
||
19 | |||
20 | // check if the error is whitelisted to overrule the message |
||
21 | if (in_array( |
||
22 | $exception->getClass(), |
||
23 | $this->container->getParameter('show_messages_for') |
||
24 | )) { |
||
25 | $message = $exception->getMessage(); |
||
26 | } |
||
27 | |||
28 | // translate page not found messages |
||
29 | if ('Symfony\Component\HttpKernel\Exception\NotFoundHttpException' == $exception->getClass()) { |
||
30 | $message = $translator->trans('error.messages.noRouteFound'); |
||
31 | } |
||
32 | |||
33 | return $this->render( |
||
34 | '@SumoCodersFrameworkCore/Exception/error.html.twig', |
||
35 | array( |
||
36 | 'status_code' => $exception->getStatusCode(), |
||
37 | 'status_text' => $message, |
||
38 | ) |
||
39 | ); |
||
40 | } |
||
41 | } |
||
42 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.