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 error handling for unconfigured drive offset #478

Closed
jwflory opened this issue Apr 16, 2020 · 2 comments
Closed

Better error handling for unconfigured drive offset #478

jwflory opened this issue Apr 16, 2020 · 2 comments
Labels
Accepted Accepted issue on our roadmap Design Design or UX/UI related Improvement Minor improvement to code
Milestone

Comments

@jwflory
Copy link

jwflory commented Apr 16, 2020

Summary

Add less verbose and clear error handling when whipper cd is run without a drive offset configured

Background

When I first used whipper, I didn't realize I needed the drive offset first. There is a large, mostly unhelpful stacktrace where the ValueError is raised. Suppressing the stdout to a single-line error would be a small quality-of-life enhancement for my logging.

Details

Reproduced the first time I ran whipper:

whipper cd -d /dev/sr1 rip
Traceback (most recent call last):
  File "/usr/bin/whipper", line 11, in <module>
    load_entry_point('whipper==0.9.0', 'console_scripts', 'whipper')()
  File "/usr/lib64/python3.7/site-packages/whipper/command/main.py", line 42, in main
    cmd = Whipper(sys.argv[1:], os.path.basename(sys.argv[0]), None)
  File "/usr/lib64/python3.7/site-packages/whipper/command/basecommand.py", line 117, in __init__
    self.options
  File "/usr/lib64/python3.7/site-packages/whipper/command/basecommand.py", line 117, in __init__
    self.options
  File "/usr/lib64/python3.7/site-packages/whipper/command/basecommand.py", line 104, in __init__
    self.handle_arguments()
  File "/usr/lib64/python3.7/site-packages/whipper/command/cd.py", line 304, in handle_arguments
    raise ValueError("Drive offset is unconfigured.\n"
ValueError: Drive offset is unconfigured.
Please install pycdio and run 'whipper offset find' to detect your drive's offset or set it manually in the configuration file. It can also be specified at runtime using the '--offset=value' argument

Just the last line is helpful for me as an end-user.

Outcome

  • Easier to read and understand error logs
  • Produces more readable, less verbose system logs
@github-actions
Copy link

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing instructions.

@JoeLametta JoeLametta added Improvement Minor improvement to code Design Design or UX/UI related Accepted Accepted issue on our roadmap labels May 29, 2020
@JoeLametta JoeLametta added this to the 1.0 milestone May 29, 2020
@jwflory
Copy link
Author

jwflory commented May 29, 2020

Thanks for fixing this! 🌹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Design Design or UX/UI related Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

2 participants