Sandbox events so exceptions being thrown don't break the client.

This commit is contained in:
Rapptz
2015-08-23 02:43:04 -04:00
parent 75f7e0a63a
commit 1f980361e3
2 changed files with 13 additions and 5 deletions

View File

@ -18,6 +18,7 @@ Event Reference
~~~~~~~~~~~~~~~~
This page outlines the different types of events listened to by :meth:`Client.event`.
All events are 'sandboxed', in that if an exception is thrown while the event is called then it is caught and then ignored.
.. function:: on_ready()
@ -34,7 +35,8 @@ This page outlines the different types of events listened to by :meth:`Client.ev
.. function:: on_response(response)
Called whenever a message is received from the websocket. Used mainly for debugging purposes.
The parameter passed is raw data that was parsed via ``json.loads``.
The parameter passed is raw data that was parsed via ``json.loads``. Note that this is called
before the :class:`Client` processes the event.
:param response: The received message response after gone through ``json.loads``.