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

How to show unpack errors to the user #6

Open
ChillerDragon opened this issue Jun 27, 2024 · 0 comments
Open

How to show unpack errors to the user #6

ChillerDragon opened this issue Jun 27, 2024 · 0 comments

Comments

@ChillerDragon
Copy link
Member

As of right now if a message fails to unpack it will become a unknown message and no error is ever bubbled up to the user.
As a user I am sometimes interested in a full list of all the unpack errors that occurred in one packet.

This is where the errors get lost at the moment

https://github.com/teeworlds-go/go-teeworlds-protocol/blob/eed93918e7be3b64e482472f24f858af47d3f339/protocol7/packet.go#L243-L253

Would it be nice to have a Errors []error field on the Packet struct? Should every single failed call to unpacker call the user hook OnError()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant