This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -60,18 +60,18 @@ public function onDispatch(MvcEvent $event)
6060 $ caughtException = null ;
6161 try {
6262 $ return = $ middleware (Psr7Request::fromZend ($ request ), Psr7Response::fromZend ($ response ));
63- } catch (\Throwable $ exception ) {
64- $ caughtException = $ exception ;
65- } catch (\Exception $ exception ) { // @TODO clean up once PHP 7 requirement is enforced
66- $ caughtException = $ exception ;
63+ } catch (\Throwable $ ex ) {
64+ $ caughtException = $ ex ;
65+ } catch (\Exception $ ex ) { // @TODO clean up once PHP 7 requirement is enforced
66+ $ caughtException = $ ex ;
6767 }
6868
6969 if ($ caughtException !== null ) {
7070 $ event ->setName (MvcEvent::EVENT_DISPATCH_ERROR );
7171 $ event ->setError ($ application ::ERROR_EXCEPTION );
7272 $ event ->setController ($ middlewareName );
7373 $ event ->setControllerClass (get_class ($ middleware ));
74- $ event ->setParam ('exception ' , $ exception );
74+ $ event ->setParam ('exception ' , $ caughtException );
7575
7676 $ events = $ application ->getEventManager ();
7777 $ results = $ events ->triggerEvent ($ event );
Original file line number Diff line number Diff line change @@ -111,14 +111,14 @@ public function render(MvcEvent $e)
111111
112112 if ($ caughtException !== null ) {
113113 if ($ e ->getName () === MvcEvent::EVENT_RENDER_ERROR ) {
114- throw $ ex ;
114+ throw $ caughtException ;
115115 }
116116
117117 $ application = $ e ->getApplication ();
118118 $ events = $ application ->getEventManager ();
119119
120120 $ e ->setError (Application::ERROR_EXCEPTION );
121- $ e ->setParam ('exception ' , $ ex );
121+ $ e ->setParam ('exception ' , $ caughtException );
122122 $ e ->setName (MvcEvent::EVENT_RENDER_ERROR );
123123 $ events ->triggerEvent ($ e );
124124 }
You can’t perform that action at this time.
0 commit comments