8000 [Serializer] Keep stack trace for enum value denormalizer error · symfony/symfony@3e341d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e341d5

Browse files
committed
[Serializer] Keep stack trace for enum value denormalizer error
1 parent 6b8b52d commit 3e341d5

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, previous: $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