From 692a4a48d5f8f74a06d0b5890e31887a76a903f3 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sat, 8 Jul 2017 13:58:36 -0400 Subject: Improve exception handling, introduce autoloading --- private/Model/Connection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'private/Model/Connection.php') diff --git a/private/Model/Connection.php b/private/Model/Connection.php index 48cf4fb..4afa330 100644 --- a/private/Model/Connection.php +++ b/private/Model/Connection.php @@ -19,6 +19,7 @@ class Connection public function __construct () { // Establish connection to db + // breaks side-effect rule include 'creds.php'; try { @@ -34,7 +35,7 @@ class Connection } catch (\PDOException $err) { // we destroy $cred as quickly as possible $cred = null; - die(json_encode(array("Result-Type" => "ERROR", "Content" => array($err->getMessage())))); + throw $err; // throw for Controller to catch } return $this; } -- cgit