Merge pull request #507 from whipper-team/bugfix/issue-385-missing-cd-warning

Provide better error message when there's no CD in the drive
This commit is contained in:
JoeLametta
2020-09-23 19:52:50 +02:00
committed by GitHub
2 changed files with 30 additions and 0 deletions

View File

@@ -94,6 +94,9 @@ class _CD(BaseCommand):
utils.load_device(self.device)
utils.unmount_device(self.device)
# Exit and inform the user if there's no CD in the disk drive
if drive.get_cdrom_drive_status(self.device): # rc == 1 means no disc
raise OSError("no CD detected, please insert one and retry")
# first, read the normal TOC, which is fast
self.ittoc = self.program.getFastToc(self.runner, self.device)