From d91a40d718fdc3d9f1d7e11008348f6ed3d2cb61 Mon Sep 17 00:00:00 2001 From: Balthasar Reuter Date: Sat, 30 May 2015 23:36:01 +0200 Subject: [PATCH] Minor changes in error handling --- photobooth.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/photobooth.py b/photobooth.py index a9bd6a4..a5029c6 100755 --- a/photobooth.py +++ b/photobooth.py @@ -274,18 +274,10 @@ class Camera: except subprocess.CalledProcessError as e: if "Canon EOS Capture failed: 2019" in e.output: raise CameraException("Can't focus! Move and try again!") - elif "Could not detect any camera" in e.output: + elif "No camera found" in e.output: raise CameraException("No (supported) camera detected!") else: raise CameraException("Unknown error!\n" + '\n'.join(e.output.split('\n')[1:3])) - # # Handle non-fatal errors - # if "Canon EOS Capture failed: 2019" in output: - # raise CameraException("Can't focus! Move and try again!") - # elif "Could not detect any camera" in output: - # raise CameraException("No (supported) camera detected!") - # elif "ERROR" in output: - # raise CameraException("Unknown error:\n" + output) - # Return the command line output return output def preview(self, filename="/tmp/preview.jpg"):