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) self.camera.wait_recording(2)
except ConnectionError: except ConnectionError:
self.logger.info('Client closed connection') self.logger.info('Client closed connection')
try: try: self.stop_recording()
self.stop_recording() except: pass
connection.close()
except: try: connection.close()
pass except: pass
self.send_camera_action(self.CameraAction.START_RECORDING) self.send_camera_action(self.CameraAction.START_RECORDING)