Skip to content

Commit

Permalink
Remove unecessary try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Dec 3, 2024
1 parent 02cedfd commit 7498eb5
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions packages/jupyter-ai/jupyter_ai/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7498eb5

Please sign in to comment.