Wrap camera stop and connection close in two distinct try-catch blocks

This commit is contained in:
Fabio Manganiello 2018-09-05 15:29:14 +00:00
parent 5cfbd75250
commit 53ba5f6628

View file

@ -125,11 +125,11 @@ class CameraPiBackend(Backend):
self.camera.wait_recording(2)
except ConnectionError:
self.logger.info('Client closed connection')
try:
self.stop_recording()
connection.close()
except:
pass
try: self.stop_recording()
except: pass
try: connection.close()
except: pass
self.send_camera_action(self.CameraAction.START_RECORDING)