From 2f8df5467deb1fb58e870712d63b90ecb84ca788 Mon Sep 17 00:00:00 2001 From: Frederic Date: Sun, 10 Dec 2017 13:34:04 +0100 Subject: [PATCH] don't crash in case a frame cannot be sent --- utils/blphub.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/blphub.py b/utils/blphub.py index fe7def0..e4efbc1 100755 --- a/utils/blphub.py +++ b/utils/blphub.py @@ -69,7 +69,11 @@ class BLPHub(): self.__lastFrameTimeout = ( currentTime + self.__streams[stream]['timeout'] ) - self.__output.sendFrame(frame) + try: + self.__output.sendFrame(frame) + except Exception as e: + # TODO better error handling + print('could not send frame: %s' % (repr(e))) return True return False