We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b729267 commit bd1237cCopy full SHA for bd1237c
1 file changed
src/Application.php
@@ -795,6 +795,19 @@ protected function initSystem(){
795
796
// exception handler
797
set_exception_handler(function($exception){
798
+ /** @var \Exception|\Throwable $exception */
799
+ // Convert throwable to exception fpr backwards compatibility
800
+ if(!($exception instanceof \Exception)){
801
+ $throwable = $exception;
802
+ $exception = new \ErrorException(
803
+ $throwable->getMessage(),
804
+ $throwable->getCode(),
805
+ E_ERROR,
806
+ $throwable->getFile(),
807
+ $throwable->getLine()
808
+ );
809
+ }
810
+
811
$event = $this->getApplicationEvent();
812
$this->emit($event->setName(self::EVENT_SYSTEM_EXCEPTION), $exception);
813
});
0 commit comments