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

other: Add the config path to the error message if unable to create config #1515

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

CosmicHorrorDev
Copy link
Contributor

@CosmicHorrorDev CosmicHorrorDev commented Jul 31, 2024

Description

A description of the change, what it does, and why it was made. If relevant (such as any change that modifies the UI), please provide screenshots of the changes:

Adds the resolved config path to the error message returned from failed to get or create the config file. E.g.

$ rm -rf ~/.config/bottom

$ chmod -w ~/.config

$ c r
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/btm`
Error: Unable to parse or create the config file at: /home/cosmic/.config/bottom/bottom.toml

Caused by:
    Error with the config file or the arguments: Permission denied (os error 13)

The motivation was that I was showing btm to a friend, but it was failing to run on their computer due to some cursed issues on their home folder: however, the specific path that is causing an issue is missing from the message making things harder to debug

Issue

If applicable, what issue does this address?

I couldn't find any existing relevant issues

Testing

If relevant, please state how this was tested. All changes must be tested to work:

Tested using the commands listed in the description (which does wipe your existing bottom folder)

If this is a code change, please also indicate which platforms were tested:

  • Windows
  • macOS
  • Linux

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, doc pages, etc.) skipped
  • The pull request passes the provided CI pipeline only fails from coverage which I' m counting as a pass
  • There are no merge conflicts
  • If relevant, new tests were added (don't worry too much about coverage) skipped

@ClementTsang
Copy link
Owner

Thanks! Seems like a good improvement to me.

@ClementTsang ClementTsang merged commit 8f995f8 into ClementTsang:main Jul 31, 2024
32 of 35 checks passed
@ClementTsang
Copy link
Owner

@all-contributors please add @CosmicHorrorDev for code.

Copy link
Contributor

@ClementTsang

I've put up a pull request to add @CosmicHorrorDev! 🎉

@ClementTsang ClementTsang mentioned this pull request Jul 31, 2024
9 tasks
@ClementTsang ClementTsang changed the title refactor: Add the config path to the error message other: Add the config path to the error message if unable to create config Jul 31, 2024
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