Skip to content

Commit

Permalink
TASK: Revert currently unused error handling strategy from workspace …
Browse files Browse the repository at this point in the history
…command handler

Before 394db57 we required the ->throw() behaviour of neos/neos-development-collection#5315 to catch the `ConcurrencyException` inside in the command handler.
  • Loading branch information
mhsdesign committed Oct 26, 2024
1 parent 4cdd170 commit 7342690
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions Classes/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,25 +105,7 @@ public function handle(CommandInterface $command): void
foreach ($eventsToPublishOrGenerator as $eventsToPublish) {
assert($eventsToPublish instanceof EventsToPublish); // just for the ide
$eventsToPublish = $this->enrichEventsToPublishWithMetadata($eventsToPublish);
try {
$this->eventPersister->publishEvents($this, $eventsToPublish);
} catch (ConcurrencyException $e) {
// we pass the exception into the generator, so it could be try-caught and reacted upon:
//
// try {
// yield EventsToPublish();
// } catch (ConcurrencyException $e) {
// yield $restoreState();
// throw $e;
// }

$errorStrategy = $eventsToPublishOrGenerator->throw($e);

if ($errorStrategy instanceof EventsToPublish) {
$eventsToPublish = $this->enrichEventsToPublishWithMetadata($errorStrategy);
$this->eventPersister->publishEvents($this, $eventsToPublish);
}
}
$this->eventPersister->publishEvents($this, $eventsToPublish);
}
}
}
Expand Down

0 comments on commit 7342690

Please sign in to comment.