Skip to content

Conversation

@njasm
Copy link
Contributor

@njasm njasm commented Nov 14, 2020

This PR is a small initial refactorization for better error handling.

  • included log and env_logger crates and added some console messages.
  • uniformed functions and methods that returns Result<T, E> with a wide range of Es into anyhow::Error since we already have that crate in the app.
  • refactor some unwrap() calls that could make the application panic (mainly on the gh api requests section) to better cope with eventual errors and not letting the app abort because of spurious errors.
  • plus one or two minor changes (mainly cosmetics)

@njasm njasm changed the title error handling tiny bit better error handling Nov 14, 2020
@njasm njasm changed the title tiny bit better error handling tiny change towards better error handling Nov 14, 2020
Copy link
Member

@pietroalbini pietroalbini left a comment

Choose a reason for hiding this comment

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

Left some comments. In general I'd prefer to use an explicit Result<T, Error> instead of just Result<T>. It's a few more chars to write, but it's also more explicit.

@njasm njasm force-pushed the patch_err_handling branch from cd69498 to c1c2c51 Compare November 16, 2020 22:30
@pietroalbini
Copy link
Member

Thanks!

@pietroalbini pietroalbini merged commit dd244c8 into rust-lang:master Nov 18, 2020
@njasm njasm deleted the patch_err_handling branch November 18, 2020 13:54
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