@@ -147,7 +147,7 @@ public function consume(ExtensionInterface $runtimeExtension = null): void
147147 $ extension ->onStart ($ start );
148148
149149 if ($ start ->isExecutionInterrupted ()) {
150- $ this ->onEnd ($ extension , $ startTime );
150+ $ this ->onEnd ($ extension , $ startTime, $ start -> getExitStatus () );
151151
152152 return ;
153153 }
@@ -256,7 +256,7 @@ public function consume(ExtensionInterface $runtimeExtension = null): void
256256 $ extension ->onPreConsume ($ preConsume );
257257
258258 if ($ preConsume ->isExecutionInterrupted ()) {
259- $ this ->onEnd ($ extension , $ startTime , $ subscriptionConsumer );
259+ $ this ->onEnd ($ extension , $ startTime , $ preConsume -> getExitStatus (), $ subscriptionConsumer );
260260
261261 return ;
262262 }
@@ -267,7 +267,7 @@ public function consume(ExtensionInterface $runtimeExtension = null): void
267267 $ extension ->onPostConsume ($ postConsume );
268268
269269 if ($ interruptExecution || $ postConsume ->isExecutionInterrupted ()) {
270- $ this ->onEnd ($ extension , $ startTime , $ subscriptionConsumer );
270+ $ this ->onEnd ($ extension , $ startTime , $ postConsume -> getExitStatus (), $ subscriptionConsumer );
271271
272272 return ;
273273 }
@@ -286,11 +286,12 @@ public function setFallbackSubscriptionConsumer(SubscriptionConsumer $fallbackSu
286286 $ this ->fallbackSubscriptionConsumer = $ fallbackSubscriptionConsumer ;
287287 }
288288
289- private function onEnd (ExtensionInterface $ extension , int $ startTime , SubscriptionConsumer $ subscriptionConsumer = null ): void
289+ private function onEnd (ExtensionInterface $ extension , int $ startTime , ? int $ exitStatus = null , SubscriptionConsumer $ subscriptionConsumer = null ): void
290290 {
291291 $ endTime = (int ) (microtime (true ) * 1000 );
292292
293- $ extension ->onEnd (new End ($ this ->interopContext , $ startTime , $ endTime , $ this ->logger ));
293+ $ endContext = new End ($ this ->interopContext , $ startTime , $ endTime , $ this ->logger , $ exitStatus );
294+ $ extension ->onEnd ($ endContext );
294295
295296 if ($ subscriptionConsumer ) {
296297 $ subscriptionConsumer ->unsubscribeAll ();
0 commit comments