From 7498eb5dc8dd75241f740b9991287f510e88c44c Mon Sep 17 00:00:00 2001 From: Nicolas Brichet Date: Tue, 3 Dec 2024 17:57:02 +0100 Subject: [PATCH] Remove unecessary try/except --- packages/jupyter-ai/jupyter_ai/extension.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/jupyter-ai/jupyter_ai/extension.py b/packages/jupyter-ai/jupyter_ai/extension.py index 952230b72..c4c03775c 100644 --- a/packages/jupyter-ai/jupyter_ai/extension.py +++ b/packages/jupyter-ai/jupyter_ai/extension.py @@ -293,17 +293,14 @@ def on_change(self, chat: YChat, events: ArrayEvent) -> None: if message["sender"] == BOT["username"] or message["raw_time"]: continue - try: - chat_message = HumanChatMessage( - id=message["id"], - time=time.time(), - body=message["body"], - prompt="", - selection=None, - client=None, - ) - except Exception as e: - self.log.error(e) + chat_message = HumanChatMessage( + id=message["id"], + time=time.time(), + body=message["body"], + prompt="", + selection=None, + client=None, + ) if self.serverapp is not None: self.serverapp.io_loop.asyncio_loop.create_task( # type:ignore[attr-defined] self._route(chat_message, chat)