From 60c87a8e3d7b1e19be38b244abd21458335a40c4 Mon Sep 17 00:00:00 2001 From: SvenVD Date: Tue, 28 Apr 2020 01:35:37 +0200 Subject: [PATCH] Add fallback exception handler for http probe --- RELEASE_NOTES.md | 4 ++++ surveillance/core/CameraStream.py | 3 +++ surveillance/surveillance.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 16e285b..9773021 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,8 @@ # rpisurv 2 release notes +## Changes in 2.1.7 +Http probe did not handle all exceptions which could crash rpisurv on rare occasions like described in the [link](https://www.tapatalk.com/groups/rpisurv/viewtopic.php?p=339#p339). +Fixed by inserting a fallback exception handler in the http probe logic. + ## Changes in 2.1.6 Added "aidx" option to be able to enable audio for a particular stream [link](https://www.tapatalk.com/groups/rpisurv/audio-t11-s20.html). This is a one to one mapping with the omxplayer aidx (Audio stream index) option, the default for rpisurv is the value -1 (audio disabled). diff --git a/surveillance/core/CameraStream.py b/surveillance/core/CameraStream.py index 8159258..7258ff4 100644 --- a/surveillance/core/CameraStream.py +++ b/surveillance/core/CameraStream.py @@ -178,6 +178,9 @@ def is_connectable(self): except socket.timeout as e: logger.error("CameraStream: " + self.name + " " + str(self.obfuscated_credentials_url) + " Not Connectable (failed socket connect, configured timeout: " + str(self.probe_timeout) + " ), " + repr(e)) return False + except Exception as e: + logger.error("CameraStream: " + self.name + " " + str(self.obfuscated_credentials_url) + " Not Connectable (" + repr(e) + " )") + return False else: logger.error("CameraStream: " + self.name + " Scheme " + str(self.scheme) + " in " + str(self.obfuscated_credentials_url) + " is currently not supported, you can make a feature request on https://community.rpisurv.net") sys.exit() diff --git a/surveillance/surveillance.py b/surveillance/surveillance.py index d19da35..9680453 100644 --- a/surveillance/surveillance.py +++ b/surveillance/surveillance.py @@ -112,7 +112,7 @@ def handle_keypresses(): #Setup logger logger = setup_logging() - fullversion_for_installer = "2.1.6" + fullversion_for_installer = "2.1.7" version = fullversion_for_installer logger.info("Starting rpisurv " + version)