This repository was archived by the owner on Dec 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-17
lines changed Expand file tree Collapse file tree 1 file changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -119,32 +119,36 @@ private function getClosure(): callable
119
119
120
120
$ this ->shellSoul ->writeReturnValue ($ _ );
121
121
} catch (BreakException $ _e ) {
122
- restore_error_handler ();
123
- if (ob_get_level () > 0 ) {
124
- ob_end_clean ();
125
- }
126
- $ this ->shellSoul ->writeException ($ _e );
127
-
122
+ $ this ->handleEvalException ($ _e );
128
123
return ;
129
124
} catch (ThrowUpException $ _e ) {
130
- restore_error_handler ();
131
- if (ob_get_level () > 0 ) {
132
- ob_end_clean ();
133
- }
134
- $ this ->shellSoul ->writeException ($ _e );
135
-
125
+ $ this ->handleEvalException ($ _e );
136
126
throw $ _e ;
127
+ } catch (\Error $ _e ) {
128
+ $ this ->handleEvalException (new \ErrorException (
129
+ $ _e ->getMessage (),
130
+ $ _e ->getCode (),
131
+ 1 ,
132
+ $ _e ->getFile (),
133
+ $ _e ->getLine (),
134
+ $ _e ->getPrevious ()
135
+ ));
137
136
} catch (\Exception $ _e ) {
138
- restore_error_handler ();
139
- if (ob_get_level () > 0 ) {
140
- ob_end_clean ();
141
- }
142
- $ this ->shellSoul ->writeException ($ _e );
137
+ $ this ->handleEvalException ($ _e );
143
138
}
144
139
145
140
$ this ->shellSoul ->setScopeVariables (get_defined_vars ());
146
141
};
147
142
148
143
return $ closure ;
149
144
}
145
+
146
+ private function handleEvalException (\Exception $ _e )
147
+ {
148
+ restore_error_handler ();
149
+ if (ob_get_level () > 0 ) {
150
+ ob_end_clean ();
151
+ }
152
+ $ this ->shellSoul ->writeException ($ _e );
153
+ }
150
154
}
You can’t perform that action at this time.
0 commit comments