From bcb004ab4bcb103e5daf490e3a0d1ac99f49e568 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 25 Apr 2025 12:55:06 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85(backend)=20add=20broad=20exception?= =?UTF-8?q?=20handling=20for=20non-twirp=20error=20in=20recording?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement broad exception handling to catch any non-twirp errors during recording operations. Ensures recording status is properly reset to "failed to start" when errors occur, allowing users to retry the recording while still logging errors to Sentry for investigation. It's generally a bad practice, however in this case it's fine, I am catching exception beforehand and it only acts as a fallback. --- src/backend/core/recording/worker/services.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/core/recording/worker/services.py b/src/backend/core/recording/worker/services.py index a0013edb..166dbb4f 100644 --- a/src/backend/core/recording/worker/services.py +++ b/src/backend/core/recording/worker/services.py @@ -41,6 +41,10 @@ class BaseEgressService: raise WorkerConnectionError( f"LiveKit client connection error, {e.message}." ) from e + except Exception as e: + raise WorkerConnectionError( + f"Unexpected error during LiveKit client connection: {str(e)}" + ) from e finally: await lkapi.aclose()