Added stage tests and tidied up rescue

This commit is contained in:
Joel Collins 2020-11-06 15:34:34 +00:00
parent 70437212b1
commit 0989a50558
4 changed files with 69 additions and 36 deletions

View file

@ -1,5 +1,10 @@
import logging
from .error_sources import ErrorSource, WarningSource
picamera_import_error = ErrorSource(
"Picamera module could not be imported. Check physical connections to the camera as it may be damaged."
)
def main():
error_sources = []
@ -11,6 +16,6 @@ def main():
# TODO: Parse exception object for a few different issues, and append different error sources
# E.g. pi with camera already in use, disconnected, unsupported OS, etc
logging.error(e)
error_sources.append("picamera_import_error")
error_sources.append(picamera_import_error)
return error_sources