Skip to content
Snippets Groups Projects
Commit 559c51de authored by Mark Haines's avatar Mark Haines
Browse files

Use TypeError instead of ValueError and give a nicer error mesasge

when someone calls Cache.invalidate with the wrong type.
parent 8c3a62b5
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment