Skip to content

[Messenger] Added check if json_encode succeeded #35150

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

Merged
merged 1 commit into from
Jan 7, 2020
Merged

[Messenger] Added check if json_encode succeeded #35150

merged 1 commit into from
Jan 7, 2020

Conversation

toooni
Copy link
Contributor

@toooni toooni commented Dec 30, 2019

Q A
Branch? 4.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

Similar PR as #35137 but for branch 4.3.

When trying to add a message to redis transport which can not be encoded with json_encode there is now a TransportException containing the json_last_error_msg as the message.
I had an issue where I tried to send an email through messenger by symfony mailer which contains a pdf attachment. Instead of an error while sending i got an error Encoded envelope should have at least a "body" which happened because the encoded message was false.

This is not exactly a bugfix, but IMO also not a feature worth being mentioned in the changelog so I am not sure I've filled out the Q/A correctly.

@fabpot
Copy link
Member

fabpot commented Jan 7, 2020

Thank you @toooni.

fabpot added a commit that referenced this pull request Jan 7, 2020
This PR was squashed before being merged into the 4.3 branch (closes #35150).

Discussion
----------

[Messenger] Added check if json_encode succeeded

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

Similar PR as #35137 but for branch 4.3.

When trying to add a message to redis transport which can not be encoded with `json_encode` there is now a `TransportException` containing the `json_last_error_msg` as the message.
I had an issue where I tried to send an email through messenger by symfony mailer which contains a pdf attachment. Instead of an error while sending i got an error `Encoded envelope should have at least a "body"` which happened because the encoded message was `false`.

This is not exactly a bugfix, but IMO also not a feature worth being mentioned in the changelog so I am not sure I've filled out the Q/A correctly.

Commits
-------

c2bdc4c [Messenger] Added check if json_encode succeeded
@fabpot fabpot merged commit c2bdc4c into symfony:4.3 Jan 7, 2020
@toooni toooni deleted the redis_transport_json_error43 branch January 8, 2020 10:00
This was referenced Jan 21, 2020
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.

5 participants