Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Serializer] Improve messages for unexpected resources values #34144

Merged

Conversation

fancyweb
Copy link
Contributor

@fancyweb fancyweb commented Oct 27, 2019

Q A
Branch? 3.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Before: An unexpected value could not be serialized: NULL - very misleading

After: An unexpected value could not be serialized: a "stream" resource

@OskarStark
Copy link
Contributor

What about:

An unexpected value (“stream”) could not be serialized.

It reads more fluently

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Oct 28, 2019
@fancyweb
Copy link
Contributor Author

@OskarStark It might be read it as the stream string. We could have a new sentence for resources but I wanted to keep the same for simplicity.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

with a minor proposal

src/Symfony/Component/Serializer/Encoder/XmlEncoder.php Outdated Show resolved Hide resolved
@fancyweb fancyweb force-pushed the serializer-better-message-for-resources branch from fe54704 to ad2ce27 Compare October 29, 2019 11:10
@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

nicolas-grekas added a commit that referenced this pull request Oct 30, 2019
…ues (fancyweb)

This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Improve messages for unexpected resources values

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Before: `An unexpected value could not be serialized: NULL` - very misleading

After: `An unexpected value could not be serialized: a "stream" resource`

Commits
-------

ad2ce27 [Serializer] Improve messages for unexpected resources values
@nicolas-grekas nicolas-grekas merged commit ad2ce27 into symfony:3.4 Oct 30, 2019
@fancyweb fancyweb deleted the serializer-better-message-for-resources branch October 30, 2019 12:43
This was referenced Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants