Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] Create a MessageEncodingFailedException #32117

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

Closed
Nyholm opened this issue Jun 20, 2019 · 4 comments
Closed

[Messenger] Create a MessageEncodingFailedException #32117

Nyholm opened this issue Jun 20, 2019 · 4 comments

Comments

@Nyholm
Copy link
Member

Nyholm commented Jun 20, 2019

We currently have a MessageDecodingFailedException when the messenger's serializer fails decoding message. But we have not exception thrown when encoding fails.

I suggest to create a MessageEncodingFailedException.

(btw, Im currently writing a serializer)

@Tobion
Copy link
Contributor

Tobion commented Jun 20, 2019

The purpose of the MesseDecodingFailedException is clear at the moment, see #32055 (comment)
What's the purpose of a MessageEncodingFailedException?

@Nyholm
Copy link
Member Author

Nyholm commented Jun 21, 2019

If my custom serializer fails to encode a message, then I have only \RuntimeException that I can throw.
Then transports can catch MessageEncodingFailedException to maybe try handle it. Ie, try a different serializer.

@Tobion
Copy link
Contributor

Tobion commented Jun 21, 2019

You can throw any exception. Currently SF messenger does not handle any exception when encoding. We should only add explicit exceptions if they are actually used in some way for a certain behavior. So I'm 👎 at the moment.

@Tobion
Copy link
Contributor

Tobion commented Jul 26, 2019

Closing as explained.

@Tobion Tobion closed this as completed Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants