diff --git a/platypush/backend/camera/pi.py b/platypush/backend/camera/pi.py index a8c072993..7c419a015 100644 --- a/platypush/backend/camera/pi.py +++ b/platypush/backend/camera/pi.py @@ -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)