Add previous exception to the stack when denormlizing Discriminated Object

This commit is contained in:
Julien Fastré 2024-10-01 17:14:58 +02:00
parent 803332ba5f
commit d8ad8c3605
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -47,7 +47,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa
}
}
throw new RuntimeException(sprintf('Could not find any denormalizer for those ALLOWED_TYPES: %s', \implode(', ', $context[self::ALLOWED_TYPES])));
throw new RuntimeException(sprintf('Could not find any denormalizer for those ALLOWED_TYPES: %s', \implode(', ', $context[self::ALLOWED_TYPES])), previous: $lastException ?? null);
}
public function supportsDenormalization($data, $type, $format = null, array $context = [])