From 73426900d391ea3500e88f357b4e6e62999cb3f3 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sat, 26 Oct 2024 21:00:34 +0200 Subject: [PATCH] TASK: Revert currently unused error handling strategy from workspace command handler Before 394db57d0abad00a54338eb08b2efa25b4bbbaa1 we required the ->throw() behaviour of https://github.com/neos/neos-development-collection/pull/5315 to catch the `ConcurrencyException` inside in the command handler. --- Classes/ContentRepository.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Classes/ContentRepository.php b/Classes/ContentRepository.php index 82111389..d966002f 100644 --- a/Classes/ContentRepository.php +++ b/Classes/ContentRepository.php @@ -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); } } }