aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-05-23 14:27:11 +0200
committerGravatar GitHub <[email protected]>2020-05-23 14:27:11 +0200
commit1ea471865fa68a001e25980d50e71333752add6d (patch)
treeaf2b434bdc52b452eba2decfe56eff645f260cb3
parentCI needs REDIS_PASSWORD to pass tests (diff)
Update exception message
This was incorrectly suggesting the user needed to create an instance of RedisCache, when in fact it is the parent that needs to be instantiated. Co-authored-by: Sebastiaan Zeeff <[email protected]>
-rw-r--r--bot/utils/redis_cache.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/utils/redis_cache.py b/bot/utils/redis_cache.py
index 2b60ae0c3..f9d9e571f 100644
--- a/bot/utils/redis_cache.py
+++ b/bot/utils/redis_cache.py
@@ -128,7 +128,10 @@ class RedisCache:
raise RuntimeError("RedisCache must be a class attribute.")
if instance is None:
- raise RuntimeError("You must create an instance of RedisCache to use it.")
+ raise RuntimeError(
+ "You must access the RedisCache instance through the cog instance "
+ "before accessing it using the cog's class object."
+ )
for attribute in vars(instance).values():
if isinstance(attribute, Bot):