<commit_before><?php

/*
 * This file is part of the Filos FrameworkBundle project.
 *
 * (c) <NAME> <<EMAIL>>. All rights reserved.
 */

declare(strict_types=1);

namespace Filos\FrameworkBundle\Controller;

use Filos\FrameworkBundle\Http\ResponseHeaders;
use Symfony\Bundle\TwigBundle\Controller\ExceptionController as TwigExceptionController;
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
use Twig_Environment;

final class ExceptionController extends TwigExceptionController
{
    /**
     * {@inheritdoc}.
     */
    public function __construct(Twig_Environment $twig, bool $debug = false)
    {
        parent::__construct($twig, $debug);
    }

    /**
     * {@inheritdoc}.
     */
    public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)
    {
        $response = parent::showAction($request, $exception, $logger);

        $response->setStatusCode($exception->getStatusCode());
        $response->headers->set(ResponseHeaders::ERROR_HANDLED_HEADER, true);

        return $response;
    }
}
<commit_msg>Ensure that we server always error templates<commit_after><?php

/*
 * This file is part of the Filos FrameworkBundle project.
 *
 * (c) <NAME> <<EMAIL>>. All rights reserved.
 */

declare(strict_types=1);

namespace Filos\FrameworkBundle\Controller;

use Filos\FrameworkBundle\Http\ResponseHeaders;
use Symfony\Bundle\TwigBundle\Controller\ExceptionController as TwigExceptionController;
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
use Twig_Environment;

final class ExceptionController extends TwigExceptionController
{
    /**
     * {@inheritdoc}.
     */
    public function __construct(Twig_Environment $twig, bool $debug = false)
    {
        parent::__construct($twig, $debug);
    }

    /**
     * {@inheritdoc}.
     */
    public function showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)
    {
        $request->attributes->get('showException', true);

        $response = parent::showAction($request, $exception, $logger);

        $response->setStatusCode($exception->getStatusCode());
        $response->headers->set(ResponseHeaders::ERROR_HANDLED_HEADER, true);

        return $response;
    }
}

{'fraction_non_alphanumeric': 0.11647727272727272, 'fraction_numerical': 0.0008116883116883117, 'mean_word_length': 4.2224576271186445, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '136106', 'n_tokens_mistral': 681, 'n_tokens_neox': 676, 'n_words': 142}