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)
60
60
$ caughtException = null ;
61
61
try {
62
62
$ 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 ;
67
67
}
68
68
69
69
if ($ caughtException !== null ) {
70
70
$ event ->setName (MvcEvent::EVENT_DISPATCH_ERROR );
71
71
$ event ->setError ($ application ::ERROR_EXCEPTION );
72
72
$ event ->setController ($ middlewareName );
73
73
$ event ->setControllerClass (get_class ($ middleware ));
74
- $ event ->setParam ('exception ' , $ exception );
74
+ $ event ->setParam ('exception ' , $ caughtException );
75
75
76
76
$ events = $ application ->getEventManager ();
77
77
$ results = $ events ->triggerEvent ($ event );
Original file line number Diff line number Diff line change @@ -111,14 +111,14 @@ public function render(MvcEvent $e)
111
111
112
112
if ($ caughtException !== null ) {
113
113
if ($ e ->getName () === MvcEvent::EVENT_RENDER_ERROR ) {
114
- throw $ ex ;
114
+ throw $ caughtException ;
115
115
}
116
116
117
117
$ application = $ e ->getApplication ();
118
118
$ events = $ application ->getEventManager ();
119
119
120
120
$ e ->setError (Application::ERROR_EXCEPTION );
121
- $ e ->setParam ('exception ' , $ ex );
121
+ $ e ->setParam ('exception ' , $ caughtException );
122
122
$ e ->setName (MvcEvent::EVENT_RENDER_ERROR );
123
123
$ events ->triggerEvent ($ e );
124
124
}
You can’t perform that action at this time.
0 commit comments