[commands] Document exceptions being ignored in teardown and cog_unload

Co-authored-by: Josh <josh.ja.butt@gmail.com>
This commit is contained in:
Sebastian Law 2023-05-23 17:31:49 -07:00 committed by GitHub
parent 0e727d8e6d
commit 2ab6541715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -550,6 +550,8 @@ class Cog(metaclass=CogMeta):
Subclasses must replace this if they want special unloading behaviour.
Exceptions raised in this method are ignored during extension unloading.
.. versionchanged:: 2.0
This method can now be a :term:`coroutine`.

View File

@ -54,6 +54,8 @@ Cleaning Up
Although rare, sometimes an extension needs to clean-up or know when it's being unloaded. For cases like these, there is another entry point named ``teardown`` which is similar to ``setup`` except called when the extension is unloaded.
Exceptions raised in the ``teardown`` function are ignored, and the extension is still unloaded.
.. code-block:: python3
:caption: basic_ext.py