Permalink
Browse files

Check rethrowFinalException and throw the exception if set

  • Loading branch information...
1 parent 93337f4 commit a265490b0670e91f6a46ba6d7496b41add5c443b @matslindh matslindh committed Nov 15, 2016
Showing with 7 additions and 1 deletion.
  1. +7 −1 public/index.php
View
@@ -22,5 +22,11 @@
$application->run($config);
} catch (BaseException $e) {
header('HTTP/1.1 500 Internal Server Error');
- trigger_error('Uncaught Exception with message: ' . $e->getMessage(), E_USER_ERROR);
+
+ // check if we should rethrow the exception and let PHP generate a fatal exception error with a proper stack trace
+ if (!empty($config['rethrowFinalException'])) {
+ throw $e;
+ } else {
+ trigger_error('Uncaught Exception with message: ' . $e->getMessage(), E_USER_ERROR);
+ }
}

0 comments on commit a265490

Please sign in to comment.