From e25f023d4377a2b99b4be8bf7977f3fc0f8089c8 Mon Sep 17 00:00:00 2001 From: Alex Shadie Date: Sat, 3 Mar 2018 22:21:58 +0300 Subject: [PATCH] Fixed exception catching (php < 7) --- flight/Engine.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flight/Engine.php b/flight/Engine.php index 53fbcfb..0fd9c50 100644 --- a/flight/Engine.php +++ b/flight/Engine.php @@ -403,7 +403,7 @@ class Engine { /** * Sends an HTTP 500 response for any errors. * - * @param object $e Thrown exception + * @param \Exception|\Throwable $e Thrown exception */ public function _error($e) { $msg = sprintf('

500 Internal Server Error

'. @@ -421,7 +421,9 @@ class Engine { ->write($msg) ->send(); } - catch (\Throwable $t) { + catch (\Throwable $t) { // PHP 7.0+ + exit($msg); + } catch(\Exception $e) { // PHP < 7 exit($msg); } }