diff --git a/src/Serializer/AbstractItemNormalizer.php b/src/Serializer/AbstractItemNormalizer.php index 0c4f52c520..457a1eff04 100644 --- a/src/Serializer/AbstractItemNormalizer.php +++ b/src/Serializer/AbstractItemNormalizer.php @@ -947,7 +947,7 @@ protected function getAttributeValue(object $object, string $attribute, ?string $attributeValue = $this->propertyAccessor->getValue($object, $attribute); if (!\is_object($attributeValue) && null !== $attributeValue) { - throw new UnexpectedValueException('Unexpected non-object value for to-one relation.'); + throw new UnexpectedValueException('Unexpected non-object value for to-one relation on class `'.$object::class.'` for attribute `'.$attribute.'`.'); } $resourceClass = $this->resourceClassResolver->getResourceClass($attributeValue, $className);