From 26e4f2c6ff3e3e677309c1a72fb9efdb8647a42e Mon Sep 17 00:00:00 2001 From: Ricky Ramirez Date: Mon, 22 Jul 2013 13:31:33 -0700 Subject: [PATCH] thing: Catch KeyErrors in _by_fullname. A key error will happen if the thing type is invalid. --- r2/r2/lib/db/thing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r2/r2/lib/db/thing.py b/r2/r2/lib/db/thing.py index 17ca7b9f1..86d749a32 100644 --- a/r2/r2/lib/db/thing.py +++ b/r2/r2/lib/db/thing.py @@ -485,7 +485,7 @@ class DataThing(object): thing_id = int(thing_id, 36) lookup[fullname] = (real_type, thing_id) table.setdefault(real_type, []).append(thing_id) - except ValueError: + except (KeyError, ValueError): if single: raise NotFound