From d7fd3fb5075c1de820988a59749ffb722d726bd7 Mon Sep 17 00:00:00 2001 From: JoeLametta Date: Fri, 9 Nov 2018 08:00:00 +0000 Subject: [PATCH 1/2] Convert print statement to logger warning Clarify the description of the error. --- whipper/command/offset.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/whipper/command/offset.py b/whipper/command/offset.py index d7f7e24b..d347be78 100644 --- a/whipper/command/offset.py +++ b/whipper/command/offset.py @@ -93,7 +93,8 @@ def do(self): try: responses = accurip.get_db_entry(table.accuraterip_path()) except accurip.EntryNotFound: - print('Accuraterip entry not found') + logger.warning("AccurateRip entry not found: drive offset " + "can't be determined, try again with another disc") if responses: logger.debug('%d AccurateRip responses found.' % len(responses)) From 09c3e4771d955473e4adf8c7ab3b5ae415acc185 Mon Sep 17 00:00:00 2001 From: JoeLametta Date: Fri, 9 Nov 2018 08:00:00 +0000 Subject: [PATCH 2/2] Prevent exception in offset find Whipper offset find needs a (remote) matching AccurateRip entry to perform its task and confirm the drive offset: if none is found, return early to prevent exception. Fixes #208. --- whipper/command/offset.py | 1 + 1 file changed, 1 insertion(+) diff --git a/whipper/command/offset.py b/whipper/command/offset.py index d347be78..201cd1ac 100644 --- a/whipper/command/offset.py +++ b/whipper/command/offset.py @@ -95,6 +95,7 @@ def do(self): except accurip.EntryNotFound: logger.warning("AccurateRip entry not found: drive offset " "can't be determined, try again with another disc") + return if responses: logger.debug('%d AccurateRip responses found.' % len(responses))