diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-08-10 14:07:08 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-08-10 14:07:17 +0100 |
commit | 559c51debcf5402cd5999aa1afb854b34e9de363 (patch) | |
tree | c74a421dacebba5c32bba2d6f57eae06771bf608 | |
parent | Merge pull request #215 from matrix-org/erikj/cache_varargs_interface (diff) | |
download | synapse-559c51debcf5402cd5999aa1afb854b34e9de363.tar.xz |
Use TypeError instead of ValueError and give a nicer error mesasge
when someone calls Cache.invalidate with the wrong type.
-rw-r--r-- | synapse/storage/_base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index e76ee2779a..73eea157a4 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -116,7 +116,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) |