Skip to content

Commit 73db558

Browse files
author
Richard Jones
committed
More informative error message
1 parent 8cff659 commit 73db558

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

roundup/backends/back_anydbm.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.36 2002-06-19 03:07:19 richard Exp $
18+
#$Id: back_anydbm.py,v 1.37 2002-06-20 23:52:35 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -335,7 +335,10 @@ def getjournal(self, classname, nodeid):
335335
if str(error) == "need 'c' or 'n' flag to open new db": return []
336336
elif error.args[0] != 2: raise
337337
return []
338-
journal = marshal.loads(db[nodeid])
338+
try:
339+
journal = marshal.loads(db[nodeid])
340+
except KeyError:
341+
raise KeyError, 'no such %s %s'%(classname, nodeid)
339342
res = []
340343
for entry in journal:
341344
(nodeid, date_stamp, user, action, params) = entry
@@ -483,6 +486,9 @@ def rollback(self):
483486

484487
#
485488
#$Log: not supported by cvs2svn $
489+
#Revision 1.36 2002/06/19 03:07:19 richard
490+
#Moved the file storage commit into blobfiles where it belongs.
491+
#
486492
#Revision 1.35 2002/05/25 07:16:24 rochecompaan
487493
#Merged search_indexing-branch with HEAD
488494
#

0 commit comments

Comments
 (0)