Provide better error message when there's no CD in the drive

Fixes #385.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
JoeLametta
2020-09-17 19:18:27 +00:00
parent 3acc3ffed6
commit 921e25bf98
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)