Skip to content

Commit 426273e

Browse files
authored
Handle type error constructing input
1 parent 68f27ef commit 426273e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,16 @@ protected function instantiateObject(array &$data, string $class, array &$contex
425425
throw $e;
426426
}
427427

428+
$exception = NotNormalizableValueException::createForUnexpectedDataType(
429+
$e->getMessage(),
430+
$data,
431+
[$class],
432+
$context['deserialization_path'] ?? null,
433+
true,
434+
previous: $e,
435+
);
436+
$context['not_normalizable_value_exceptions'][] = $exception;
437+
428438
return $reflectionClass->newInstanceWithoutConstructor();
429439
}
430440
}

0 commit comments

Comments
 (0)