From 0fa57de47c7452591db8a74d00a0ffa4ca80c546 Mon Sep 17 00:00:00 2001 From: marcosmazz Date: Wed, 8 Mar 2017 14:12:06 -0300 Subject: [PATCH] Catch PDO expeption the right way When the dabase server is down the exception was not caught due to namespaces ref: http://php.net/manual/es/language.exceptions.php#97963 --- application/Core/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/Core/Model.php b/application/Core/Model.php index c7502c9..7602a2f 100644 --- a/application/Core/Model.php +++ b/application/Core/Model.php @@ -18,7 +18,7 @@ function __construct() { try { self::openDatabaseConnection(); - } catch (PDOException $e) { + } catch (\PDOException $e) { exit('Database connection could not be established.'); } }