--- /dev/null
+<?php
+
+namespace Rapsys\AirBundle\Controller;
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+#use Symfony\Component\Security\Core\Exception\AccessDeniedException;
+#use Symfony\Component\Security\Http\Authorization\AccessDeniedHandlerInterface;
+#use Symfony\Component\DependencyInjection\ContainerInterface;
+#use Symfony\Component\Routing\RouterInterface;
+#use Symfony\Component\Translation\TranslatorInterface;
+#use Twig\Environment;
+
+#use Symfony\Component\Debug\Exception\FlattenException;
+use Symfony\Component\ErrorHandler\Exception\FlattenException;
+
+class ErrorController extends DefaultController {
+ /**
+ * {@inheritdoc}
+ */
+ public function preview(Request $request, FlattenException $exception) {
+ //Set section
+ $section = $exception->getStatusCode().' '.$this->translator->trans($exception->getStatusText());
+
+ //Set title
+ $title = $section.' - '.$this->translator->trans($this->config['site']['title']);
+
+ //Set the message
+ $message = $exception->getMessage();
+
+ //Set the trace
+ $trace = $exception->getAsString();
+
+ //Render template
+ return $this->render(
+ '@RapsysAir/error.html.twig',
+ ['title' => $title, 'section' => $section, 'message' => $message, 'trace' => $trace]+$this->context
+ );
+ }
+}
--- /dev/null
+{% extends '@RapsysAir/body.html.twig' %}
+{% block content %}
+<section id="content">
+ <h2><a href="{{ path('rapsys_air') }}">{{ section }}</a></h2>
+ <p class="error">{% if message %}{{ message }}{% else %}{% trans %}Error{% endtrans %}{% endif %}</p>
+ {% if app.environment == 'dev' and trace is defined %}<pre class="trace">{{ trace }}</pre>{% endif %}
+</section>
+{% endblock %}