File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 77
88namespace ZF \ApiProblem \Listener ;
99
10+ use Exception ;
11+ use Throwable ;
1012use Zend \EventManager \EventManagerInterface ;
1113use Zend \EventManager \AbstractListenerAggregate ;
1214use Zend \Http \Header \Accept as AcceptHeader ;
@@ -96,7 +98,7 @@ public function onRender(MvcEvent $e)
9698 $ status = $ e ->getResponse ()->getStatusCode ();
9799 $ exception = $ model ->getVariable ('exception ' );
98100
99- if ($ exception instanceof \ Exception) {
101+ if ($ exception instanceof Throwable || $ exception instanceof Exception) {
100102 $ apiProblem = new ApiProblem ($ status , $ exception );
101103 } else {
102104 $ apiProblem = new ApiProblem ($ status , $ model ->getVariable ('message ' ));
@@ -156,7 +158,7 @@ public function onDispatchError(MvcEvent $e)
156158
157159 // Marshall an ApiProblem and view model based on the exception
158160 $ exception = $ e ->getParam ('exception ' );
159- if (! $ exception instanceof \ Exception) {
161+ if (! ( $ exception instanceof Throwable || $ exception instanceof Exception) ) {
160162 // If it's not an exception, do not know what to do.
161163 return ;
162164 }
You can’t perform that action at this time.
0 commit comments