Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 37708cb

Browse filesBrowse 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
Copy full SHA for 37708cb

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/BackedEnumNormalizer.php
+1-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.