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

Improvements to error handling #46

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Improvements to error handling #46

merged 3 commits into from
Oct 10, 2024

Conversation

edfloreshz
Copy link
Collaborator

  • Add log dependency.
  • Remove anyhow dependency in favor of standard Result.
  • Handle unwrap() calls and report errors with log::error!.

- Add `log` dependency.
- Remove `anyhow` dependency in favor of standard `Result`.
- Handle `unwrap()` calls and report errors with `log::error!`.
@edfloreshz edfloreshz requested a review from Be-ing October 8, 2024 19:29
@edfloreshz
Copy link
Collaborator Author

I wasn't aware of #44, sorry I made a PR so similar, but this implementation should be preferred as it avoids unwrap(),

Copy link
Collaborator

@Be-ing Be-ing left a comment

Choose a reason for hiding this comment

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

Logging these errors and returning Mode::Default upon error seems reasonable. 👍 Just a few minor suggestions to make the logs more explicit what the source of the problem is.

src/platforms/freedesktop/mod.rs Outdated Show resolved Hide resolved
src/platforms/freedesktop/mod.rs Outdated Show resolved Hide resolved
@Be-ing Be-ing mentioned this pull request Oct 9, 2024
@edfloreshz
Copy link
Collaborator Author

Alright! Ready to merge 👍🏼

@Be-ing Be-ing merged commit 3eb3e93 into main Oct 10, 2024
4 checks passed
@Be-ing Be-ing deleted the improv/general branch October 10, 2024 01:17
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