Skip to content

Commit

Permalink
Merge pull request #469 from deonvdv/add-reflection-exception-message
Browse files Browse the repository at this point in the history
Add reflection exception error message to InvalidStoredEvent exception
  • Loading branch information
sebastiandedeyne authored Jun 13, 2024
2 parents 3481c37 + 1e8064c commit 403ae99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StoredEvents/StoredEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected function instantiateEvent(?ShouldBeStored $originalEvent): void
try {
$reflectionClass = new ReflectionClass($this->event_class);
} catch (ReflectionException $exception) {
throw new InvalidStoredEvent();
throw new InvalidStoredEvent($exception->getMessage());
}

if ($serializerAttribute = $reflectionClass->getAttributes(EventSerializerAttribute::class)[0] ?? null) {
Expand Down

0 comments on commit 403ae99

Please sign in to comment.