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

TaffyTree methods should have better error handling #768

Open
alice-i-cecile opened this issue Dec 24, 2024 · 3 comments
Open

TaffyTree methods should have better error handling #768

alice-i-cecile opened this issue Dec 24, 2024 · 3 comments
Labels
code quality Make the code cleaner or prettier.

Comments

@alice-i-cecile
Copy link
Collaborator

Yeah, IMO this should either be changed to return Err/None if the node doesn't exist. Or just return the value directly.

Originally posted by @nicoburns in #765 (comment)

@alice-i-cecile alice-i-cecile added the code quality Make the code cleaner or prettier. label Dec 24, 2024
@nicoburns
Copy link
Collaborator

See also #520 which has the right idea but takes things slightly too far.

@nicoburns
Copy link
Collaborator

I think we ought to:

  • Have one set of methods (with unprefixed names) that panic if e.g. the NodeId is missing
  • Have a second set of methods (prefixed with something like get_ and/or try_) that return Result or Option and actually return Err/None on failure (and never panic).

@alice-i-cecile
Copy link
Collaborator Author

I'm alright with that. Let's use the try_ prefix. I think this is old tech debt from the stretch days!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Make the code cleaner or prettier.
Projects
None yet
Development

No branches or pull requests

2 participants