Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Serializer/AbstractItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'`.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this exposing too much information?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By which you're referring to security related concerns? Disabling showing errors in prod environments imo is a userland concern, implying that exception messages can't be extensive and clear enough. The current message does not really help much in solving the issue.

}

$resourceClass = $this->resourceClassResolver->getResourceClass($attributeValue, $className);
Expand Down
Loading