10000 bug #53081 [Serializer] Keep stack trace for enum value denormalizer … · symfony/symfony@37708cb · GitHub
[go: up one dir, main page]

Skip to content

Commit 37708cb

Browse files
bug #53081 [Serializer] Keep stack trace for enum value denormalizer error (kylekatarnls)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Serializer] Keep stack trace for enum value denormalizer error | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT Simple `previous: $exception` added not to loose track of the error origin. Commits ------- de3f711 [Serializer] Keep stack trace for enum value denormalizer error
2 parents ca18765 + de3f711 commit 37708cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Serializer/Normalizer/BackedEnumNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function denormalize($data, string $type, string $format = null, array $c
6565
return $type::from($data);
6666
} catch (\ValueError $e) {
6767
if (isset($context['has_constructor'])) {
68-
throw new InvalidArgumentException('The data must belong to a backed enumeration of type '.$type);
68+
throw new InvalidArgumentException('The data must belong to a backed enumeration of type '.$type, 0, $e);
6969
}
7070

7171
throw NotNormalizableValueException::createForUnexpectedDataType('The data must belong to a backed enumeration of type '.$type, $data, [$type], $context['deserialization_path'] ?? null, true, 0, $e);

0 commit comments

Comments
 (0)
0