diff options
author | Thomas Lange <code@nerdmind.de> | 2021-06-14 20:03:19 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-06-14 20:03:19 +0200 |
commit | 78fcc20190121d487a2e6cf1fca53b66df67dc3a (patch) | |
tree | b9b0dc3da8afc923fbac80ade147305cb7079e3f /admin/page/delete.php | |
parent | d453ba414803832bb4e4f9ae5eddec7ae3f60205 (diff) | |
download | blog-78fcc20190121d487a2e6cf1fca53b66df67dc3a.tar.gz blog-78fcc20190121d487a2e6cf1fca53b66df67dc3a.tar.xz blog-78fcc20190121d487a2e6cf1fca53b66df67dc3a.zip |
Remove more redundant try/catch blocks
Remove all try/catch blocks where the exception handling did not differ
from the exception handler already defined by "set_exception_handler".
Diffstat (limited to 'admin/page/delete.php')
-rw-r--r-- | admin/page/delete.php | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/admin/page/delete.php b/admin/page/delete.php index 111910b..1406ece 100644 --- a/admin/page/delete.php +++ b/admin/page/delete.php @@ -28,33 +28,24 @@ try { } #=============================================================================== - # TRY: Template\Exception + # Build document #=============================================================================== - try { - $FormTemplate = Template\Factory::build('page/form'); - $FormTemplate->set('HTML', $Page->getHTML()); - $FormTemplate->set('FORM', [ - 'TYPE' => 'DELETE', - 'INFO' => $messages ?? [], - 'DATA' => array_change_key_case($Attribute->getAll(), CASE_UPPER), - 'TOKEN' => Application::getSecurityToken() - ]); - - $DeleteTemplate = Template\Factory::build('page/delete'); - $DeleteTemplate->set('HTML', $FormTemplate); - - $MainTemplate = Template\Factory::build('main'); - $MainTemplate->set('NAME', $Language->text('title_page_delete')); - $MainTemplate->set('HTML', $DeleteTemplate); - echo $MainTemplate; - } - - #=============================================================================== - # CATCH: Template\Exception - #=============================================================================== - catch(Template\Exception $Exception) { - Application::exit($Exception->getMessage()); - } + $FormTemplate = Template\Factory::build('page/form'); + $FormTemplate->set('HTML', $Page->getHTML()); + $FormTemplate->set('FORM', [ + 'TYPE' => 'DELETE', + 'INFO' => $messages ?? [], + 'DATA' => array_change_key_case($Attribute->getAll(), CASE_UPPER), + 'TOKEN' => Application::getSecurityToken() + ]); + + $DeleteTemplate = Template\Factory::build('page/delete'); + $DeleteTemplate->set('HTML', $FormTemplate); + + $MainTemplate = Template\Factory::build('main'); + $MainTemplate->set('NAME', $Language->text('title_page_delete')); + $MainTemplate->set('HTML', $DeleteTemplate); + echo $MainTemplate; } #=============================================================================== |