From 54b56a8a535106df685cd6aee58bb05933d7e048 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 30 Nov 2004 04:42:20 +0000 Subject: [PATCH] Raise the proper exception. --- src/dbi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dbi.py b/src/dbi.py index 602c3280f..a3a221926 100644 --- a/src/dbi.py +++ b/src/dbi.py @@ -237,7 +237,10 @@ class CdbMapping(MappingInterface): return i def get(self, id): - return self.db[str(id)] + try: + return self.db[str(id)] + except KeyError: + raise NoRecordError, id # XXX Same as above. def set(self, id, s):