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

Better handle errors encountered when running anoma binaries #1049

Open
james-chf opened this issue Apr 13, 2022 · 0 comments
Open

Better handle errors encountered when running anoma binaries #1049

james-chf opened this issue Apr 13, 2022 · 0 comments
Labels

Comments

@james-chf
Copy link
Contributor

Currently in the anoma CLIs we sometimes handle errors by calling eprintln! with a human-friendly error message, then exiting the process with status code 1, other times we just attempt an .unwrap() which panics and displays an output more helpful to developers.

We could consolidate how we're handling errors:

  • start returning Result<()> instead of safe exiting inside our functions; e.g. use .await? rather than await.unwrap() to return errors when they happen rather than panicking
  • change existing eprintln! calls to returning a Result<()>
  • at the top level, catch returned Err(error)s and always both eprintln! the Display trait output for users and log (i.e. tracing::error!) the Debug output for developers, as currently we may only get one or the other

This could be done nearer Namada release as part of polishing up if there is time

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

No branches or pull requests

1 participant