Minor changes in error handling
This commit is contained in:
@@ -274,18 +274,10 @@ class Camera:
|
|||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
if "Canon EOS Capture failed: 2019" in e.output:
|
if "Canon EOS Capture failed: 2019" in e.output:
|
||||||
raise CameraException("Can't focus! Move and try again!")
|
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!")
|
raise CameraException("No (supported) camera detected!")
|
||||||
else:
|
else:
|
||||||
raise CameraException("Unknown error!\n" + '\n'.join(e.output.split('\n')[1:3]))
|
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
|
return output
|
||||||
|
|
||||||
def preview(self, filename="/tmp/preview.jpg"):
|
def preview(self, filename="/tmp/preview.jpg"):
|
||||||
|
|||||||
Reference in New Issue
Block a user