Skip to content

Exit cleanly when no CD-DA drive is found - #714

Open
mkoester wants to merge 1 commit into
whipper-team:developfrom
mkoester:fix/no-drive-clean-exit
Open

mkoester wants to merge 1 commit into
whipper-team:developfrom
mkoester:fix/no-drive-clean-exit

Conversation

@mkoester

Copy link
Copy Markdown

When no drive is found (or -d points at a missing device), whipper logs the error and then raises an uncaught IOError, so the user sees a full traceback after the message:

CRITICAL:whipper.command.basecommand:No CD-DA drives found!
Traceback (most recent call last):
...
OSError: No CD-DA drives found!

This raises SystemExit(3) instead (the removed comment noted whipper used to exit with 3 here), matching how incorrect subcommand is already handled a few lines below. Includes unit tests for both cases.

Related to #164, which shows the same traceback for whipper cd --help; this PR does not make help work without a drive.

🤖 Generated with Claude Code

Missing drives were reported with logger.critical() and then raised as
IOError, which nothing catches, so users saw the log line followed by a
full traceback. Raise SystemExit(3) instead, as the removed comment says
whipper used to do, for both 'No CD-DA drives found!' and a --device
path that does not exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mirko Köster <git@mirkokoester.de>
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.

1 participant