You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
501 B
21 lines
501 B
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
require_once __DIR__ . "/../react-display.php";
|
|
use \Twig\Environment;
|
|
use Twig\Error\LoaderError;
|
|
use Twig\Error\RuntimeError;
|
|
use Twig\Error\SyntaxError;
|
|
|
|
class ErrorController
|
|
{
|
|
public static function displayFailures(array $failures, Environment $twig) {
|
|
try {
|
|
$twig->display("error.html.twig", ['failures' => $failures]);
|
|
} catch (LoaderError | RuntimeError | SyntaxError $e) {
|
|
echo "Twig error: $e";
|
|
}
|
|
}
|
|
}
|