aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-06-14 19:06:04 +0200
committerThomas Lange <code@nerdmind.de>2021-06-14 19:06:04 +0200
commitd453ba414803832bb4e4f9ae5eddec7ae3f60205 (patch)
treeab2e0f17634b9292a09e9afcc785f8a6dacb6513
parentfb704693dcb7591e0224a82280deb62601c8c17e (diff)
downloadblog-d453ba414803832bb4e4f9ae5eddec7ae3f60205.tar.gz
blog-d453ba414803832bb4e4f9ae5eddec7ae3f60205.tar.xz
blog-d453ba414803832bb4e4f9ae5eddec7ae3f60205.zip
Remove redundant try/catch block
Remove the redundant exception handler from core/application.php. The exception handling in the catch block did not differ from the default handler already defined by "set_exception_handler".
-rw-r--r--core/application.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/core/application.php b/core/application.php
index 3c431f8..38025b8 100644
--- a/core/application.php
+++ b/core/application.php
@@ -141,22 +141,23 @@ if(defined('ADMINISTRATION') AND ADMINISTRATION === TRUE) {
require 'functions.php';
#===============================================================================
-# TRY: PDOException
+# Get Language and Database singletons
#===============================================================================
-try {
- $Language = Application::getLanguage();
- $Database = Application::getDatabase();
-
- $Database->setAttribute($Database::ATTR_DEFAULT_FETCH_MODE, $Database::FETCH_ASSOC);
- $Database->setAttribute($Database::ATTR_ERRMODE, $Database::ERRMODE_EXCEPTION);
-}
+$Language = Application::getLanguage();
+$Database = Application::getDatabase();
#===============================================================================
-# CATCH: PDOException
+# Set Database attributes
#===============================================================================
-catch(PDOException $Exception) {
- Application::exit($Exception->getMessage());
-}
+$Database->setAttribute(
+ $Database::ATTR_DEFAULT_FETCH_MODE,
+ $Database::FETCH_ASSOC
+);
+
+$Database->setAttribute(
+ $Database::ATTR_ERRMODE,
+ $Database::ERRMODE_EXCEPTION
+);
#===============================================================================
# Check if "304 Not Modified" and ETag header should be sent