Skip to content

Commit

Permalink
Dispatch finish event when returning early to allow for cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AydinHassan committed May 25, 2024
1 parent 0659472 commit 353e5e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ExerciseDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public function verify(ExerciseInterface $exercise, Input $input): ResultAggrega
$this->results->add($check->check($context));

if (!$this->results->isSuccessful()) {
$exercise->tearDown();
$this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.finish', $context));
return $this->results;
}
}
Expand Down

0 comments on commit 353e5e3

Please sign in to comment.