diff options
author | 2020-03-22 23:56:17 +0100 | |
---|---|---|
committer | 2020-03-22 23:56:17 +0100 | |
commit | fdaca949e134f280034b65e8f9aa6890db4600d1 (patch) | |
tree | 9b0e89f9b96ddf700fc489f55c69ae69a2d528aa /bot/exceptions.py | |
parent | Deseasonify: short-circuit on non-200 response status (diff) |
Deseasonify: add exceptions module
When loading extensions, d.py circumvents the import cache
by force-reloading the target module.
As a consequence, exception class declaration get re-executed,
which may cause the error handler to not recognize the exception via
its `isinstance` checks - the raised exception may not be an instance
of the class that the error handler originally imported.
For this reason, it is safer to declare the exceptions on the side,
in a module that will not be reloaded by d.py.
Diffstat (limited to 'bot/exceptions.py')
-rw-r--r-- | bot/exceptions.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/exceptions.py b/bot/exceptions.py new file mode 100644 index 00000000..70c20e12 --- /dev/null +++ b/bot/exceptions.py @@ -0,0 +1,4 @@ +class BrandingError(Exception): + """Exception raised by the BrandingManager cog.""" + + pass |