mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 02:16:41 +00:00
Remove legacy exception catches from 2.x
This commit is contained in:
@@ -1269,12 +1269,6 @@ function twig_include(Twig_Environment $env, $context, $template, $variables = a
|
||||
$sandbox->disableSandbox();
|
||||
}
|
||||
|
||||
throw $e;
|
||||
} catch (Exception $e) {
|
||||
if ($isSandboxed && !$alreadySandboxed) {
|
||||
$sandbox->disableSandbox();
|
||||
}
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
|
||||
@@ -370,12 +370,6 @@ abstract class Twig_Template
|
||||
ob_start();
|
||||
try {
|
||||
$this->display($context);
|
||||
} catch (Exception $e) {
|
||||
while (ob_get_level() > $level) {
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
throw $e;
|
||||
} catch (Throwable $e) {
|
||||
while (ob_get_level() > $level) {
|
||||
ob_end_clean();
|
||||
|
||||
@@ -93,12 +93,6 @@ final class Twig_TemplateWrapper
|
||||
ob_start();
|
||||
try {
|
||||
$this->template->displayBlock($name, $context);
|
||||
} catch (Exception $e) {
|
||||
while (ob_get_level() > $level) {
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
throw $e;
|
||||
} catch (Throwable $e) {
|
||||
while (ob_get_level() > $level) {
|
||||
ob_end_clean();
|
||||
|
||||
@@ -250,7 +250,6 @@ EOF
|
||||
try {
|
||||
$twig->loadTemplate('1_include')->render(self::$params);
|
||||
} catch (Throwable $e) {
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
if ($e === null) {
|
||||
$this->fail('An exception should be thrown for this test to be valid.');
|
||||
|
||||
Reference in New Issue
Block a user