aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exceptions.py
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-03-22 23:56:17 +0100
committerGravatar kwzrd <[email protected]>2020-03-22 23:56:17 +0100
commitfdaca949e134f280034b65e8f9aa6890db4600d1 (patch)
tree9b0e89f9b96ddf700fc489f55c69ae69a2d528aa /bot/exceptions.py
parentDeseasonify: 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.py4
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