aboutsummaryrefslogtreecommitdiffstats
path: root/admin/database.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-06-14 20:03:19 +0200
committerThomas Lange <code@nerdmind.de>2021-06-14 20:03:19 +0200
commit78fcc20190121d487a2e6cf1fca53b66df67dc3a (patch)
treeb9b0dc3da8afc923fbac80ade147305cb7079e3f /admin/database.php
parentd453ba414803832bb4e4f9ae5eddec7ae3f60205 (diff)
downloadblog-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/database.php')
-rw-r--r--admin/database.php35
1 files changed, 13 insertions, 22 deletions
diff --git a/admin/database.php b/admin/database.php
index 14f34e1..78d47c1 100644
--- a/admin/database.php
+++ b/admin/database.php
@@ -26,26 +26,17 @@ if(HTTP::issetPOST(['token' => Application::getSecurityToken()], 'command')) {
}
#===============================================================================
-# TRY: Template\Exception
-#===============================================================================
-try {
- $DatabaseTemplate = Template\Factory::build('database');
- $DatabaseTemplate->set('FORM', [
- 'INFO' => $messages ?? [],
- 'TOKEN' => Application::getSecurityToken(),
- 'RESULT' => implode(NULL, $result ?? []),
- 'COMMAND' => HTTP::POST('command'),
- ]);
+# Build document
+#===============================================================================
+$DatabaseTemplate = Template\Factory::build('database');
+$DatabaseTemplate->set('FORM', [
+ 'INFO' => $messages ?? [],
+ 'TOKEN' => Application::getSecurityToken(),
+ 'RESULT' => implode(NULL, $result ?? []),
+ 'COMMAND' => HTTP::POST('command'),
+]);
- $MainTemplate = Template\Factory::build('main');
- $MainTemplate->set('NAME', 'SQL');
- $MainTemplate->set('HTML', $DatabaseTemplate);
- echo $MainTemplate;
-}
-
-#===============================================================================
-# CATCH: Template\Exception
-#===============================================================================
-catch(Template\Exception $Exception) {
- Application::exit($Exception->getMessage());
-}
+$MainTemplate = Template\Factory::build('main');
+$MainTemplate->set('NAME', 'SQL');
+$MainTemplate->set('HTML', $DatabaseTemplate);
+echo $MainTemplate;