Browse Source

Catch and log gateway event parsing errors

pull/10115/head
dolfies 1 month ago
parent
commit
a859edd36c
  1. 5
      discord/gateway.py

5
discord/gateway.py

@ -571,7 +571,10 @@ class DiscordWebSocket:
except KeyError:
_log.debug('Unknown event %s.', event)
else:
func(data)
try:
func(data)
except Exception as exc:
_log.warning('Parsing event %s encountered an exception.', event, exc_info=exc)
# remove the dispatched listeners
removed = []

Loading…
Cancel
Save