Skip to content

Commit b38db72

Browse files
committed
Merge pull request #1046 from lemoinem/patch-2
[BodyParamConverter] Preserve previous exception on deserialize fail
2 parents 832d081 + 5756ee3 commit b38db72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Request/AbstractRequestBodyParamConverter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ protected function execute(Request $request, ParamConverter $configuration)
118118
$context
119119
);
120120
} catch (UnsupportedFormatException $e) {
121-
throw new UnsupportedMediaTypeHttpException($e->getMessage());
121+
throw new UnsupportedMediaTypeHttpException($e->getMessage(), $e);
122122
} catch (JMSSerializerException $e) {
123-
throw new BadRequestHttpException($e->getMessage());
123+
throw new BadRequestHttpException($e->getMessage(), $e);
124124
} catch (SymfonySerializerException $e) {
125-
throw new BadRequestHttpException($e->getMessage());
125+
throw new BadRequestHttpException($e->getMessage(), $e);
126126
}
127127

128128
$request->attributes->set($configuration->getName(), $object);

0 commit comments

Comments
 (0)