Skip to content

Commit 59481dd

Browse files
committed
formatted error
1 parent 168355d commit 59481dd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

chats/consumers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ async def receive_json(self, content, **kwargs):
9999
await self.__process_chat_related_event(event, room_name)
100100
except ChatException as e:
101101
await self.send_json({"error": str(e.get_error())})
102+
except KeyError as e:
103+
await self.send_json(
104+
{
105+
"error": f"Missing key (might be backend's fault,"
106+
f" but most likely you are missing this field): {e}"
107+
}
108+
)
102109

103110
elif event.type in [EventType.SET_ONLINE, EventType.SET_OFFLINE]:
104111
room_name = EventGroupType.GENERAL_EVENTS

0 commit comments

Comments
 (0)