From df156b18e517f9267bf8e4e206aa383a6e356508 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 2 Apr 2020 00:38:00 +1100 Subject: docs,tests: Add docs and test for uasyncio custom exc handler methods. --- docs/library/uasyncio.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'docs') diff --git a/docs/library/uasyncio.rst b/docs/library/uasyncio.rst index c0d0e85d7..641fa3345 100644 --- a/docs/library/uasyncio.rst +++ b/docs/library/uasyncio.rst @@ -266,3 +266,22 @@ Event Loop .. method:: Loop.close() Close the event loop. + +.. method:: Loop.set_exception_handler(handler) + + Set the exception handler to call when a Task raises an exception that is not + caught. The *handler* should accept two arguments: ``(loop, context)``. + +.. method:: Loop.get_exception_handler() + + Get the current exception handler. Returns the handler, or ``None`` if no + custom handler is set. + +.. method:: Loop.default_exception_handler(context) + + The default exception handler that is called. + +.. method:: Loop.call_exception_handler(context) + + Call the current exception handler. The argument *context* is passed through and + is a dictionary containing keys: ``'message'``, ``'exception'``, ``'future'``. -- cgit v1.2.3