1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/util/caches/descriptors.py b/synapse/util/caches/descriptors.py
index c99fda849e..408c3b5e65 100644
--- a/synapse/util/caches/descriptors.py
+++ b/synapse/util/caches/descriptors.py
@@ -90,7 +90,9 @@ class Cache(object):
def invalidate(self, key):
self.check_thread()
if not isinstance(key, tuple):
- raise ValueError("keyargs must be a tuple.")
+ raise TypeError(
+ "The cache key must be a tuple not %r" % (type(key),)
+ )
# Increment the sequence number so that any SELECT statements that
# raced with the INSERT don't update the cache (SYN-369)
|