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

make BatchSerialize not return an error #435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwasinger
Copy link
Collaborator

Afaict, it should be safe to assume that a tree being serialized is not malformed. Otherwise, it is catastrophic (programming error) and we might as well let it panic.

Copy link
Member

@gballet gballet left a comment

Choose a reason for hiding this comment

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

That sounds like a bad idea in general. Sure finding this means that something is critically wrong, but returning the error would increase the avenues we have for debugging. What is the high-level reason why you want to panic instead?

@jwasinger
Copy link
Collaborator Author

jwasinger commented May 29, 2024

In this case, it doesn't increase the avenues for debugging. A panic will point directly to the place where the error is caused. Returning it does the same.

Seems weird to percolate an internal logic error (that a user of this lib has no reasonable way to recover from) through a public interface.

@jwasinger
Copy link
Collaborator Author

jwasinger commented May 29, 2024

Oh, I just remove the error check and don't panic at all. Happy to add that if it would make debugging easier.

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

Successfully merging this pull request may close these issues.

2 participants