File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ public function onRender(MvcEvent $e)
9696 $ status = $ e ->getResponse ()->getStatusCode ();
9797 $ exception = $ model ->getVariable ('exception ' );
9898
99- if ($ exception instanceof \Exception) {
99+ if ($ exception instanceof \Exception || $ exception instanceof \Throwable ) {
100100 $ apiProblem = new ApiProblem ($ status , $ exception );
101101 } else {
102102 $ apiProblem = new ApiProblem ($ status , $ model ->getVariable ('message ' ));
@@ -156,7 +156,7 @@ public function onDispatchError(MvcEvent $e)
156156
157157 // Marshall an ApiProblem and view model based on the exception
158158 $ exception = $ e ->getParam ('exception ' );
159- if (! $ exception instanceof \Exception) {
159+ if (! ( $ exception instanceof \Exception || $ exception instanceof \Throwable) ) {
160160 // If it's not an exception, do not know what to do.
161161 return ;
162162 }
Original file line number Diff line number Diff line change @@ -65,7 +65,11 @@ public function onRenderError(MvcEvent $e)
6565 $ details = false ;
6666
6767 $ exception = $ e ->getParam ('exception ' );
68- if ($ exception instanceof \Exception
68+ if (
69+ (
70+ $ exception instanceof \Exception
71+ || $ exception instanceof \Throwable
72+ )
6973 && ! $ exception instanceof ViewExceptionInterface
7074 ) {
7175 $ code = $ exception ->getCode ();
You can’t perform that action at this time.
0 commit comments