Merge pull request #363 from alexshadie/master

Fixed exception catching (php < 7)
pull/380/head
Mike Cao 7 years ago committed by GitHub
commit 32f7c8dbe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -403,7 +403,7 @@ class Engine {
/** /**
* Sends an HTTP 500 response for any errors. * Sends an HTTP 500 response for any errors.
* *
* @param object $e Thrown exception * @param \Exception|\Throwable $e Thrown exception
*/ */
public function _error($e) { public function _error($e) {
$msg = sprintf('<h1>500 Internal Server Error</h1>'. $msg = sprintf('<h1>500 Internal Server Error</h1>'.
@ -421,7 +421,9 @@ class Engine {
->write($msg) ->write($msg)
->send(); ->send();
} }
catch (\Throwable $t) { catch (\Throwable $t) { // PHP 7.0+
exit($msg);
} catch(\Exception $e) { // PHP < 7
exit($msg); exit($msg);
} }
} }

Loading…
Cancel
Save