@@ -147,7 +147,7 @@ public function consume(ExtensionInterface $runtimeExtension = null): void
147
147
$ extension ->onStart ($ start );
148
148
149
149
if ($ start ->isExecutionInterrupted ()) {
150
- $ this ->onEnd ($ extension , $ startTime );
150
+ $ this ->onEnd ($ extension , $ startTime, $ start -> getExitStatus () );
151
151
152
152
return ;
153
153
}
@@ -256,7 +256,7 @@ public function consume(ExtensionInterface $runtimeExtension = null): void
256
256
$ extension ->onPreConsume ($ preConsume );
257
257
258
258
if ($ preConsume ->isExecutionInterrupted ()) {
259
- $ this ->onEnd ($ extension , $ startTime , $ subscriptionConsumer );
259
+ $ this ->onEnd ($ extension , $ startTime , $ preConsume -> getExitStatus (), $ subscriptionConsumer );
260
260
261
261
return ;
262
262
}
@@ -267,7 +267,7 @@ public function consume(ExtensionInterface $runtimeExtension = null): void
267
267
$ extension ->onPostConsume ($ postConsume );
268
268
269
269
if ($ interruptExecution || $ postConsume ->isExecutionInterrupted ()) {
270
- $ this ->onEnd ($ extension , $ startTime , $ subscriptionConsumer );
270
+ $ this ->onEnd ($ extension , $ startTime , $ postConsume -> getExitStatus (), $ subscriptionConsumer );
271
271
272
272
return ;
273
273
}
@@ -286,11 +286,12 @@ public function setFallbackSubscriptionConsumer(SubscriptionConsumer $fallbackSu
286
286
$ this ->fallbackSubscriptionConsumer = $ fallbackSubscriptionConsumer ;
287
287
}
288
288
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
290
290
{
291
291
$ endTime = (int ) (microtime (true ) * 1000 );
292
292
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 );
294
295
295
296
if ($ subscriptionConsumer ) {
296
297
$ subscriptionConsumer ->unsubscribeAll ();
0 commit comments