[ZODB-Dev] George Bailey'd objects cause failure in FileStorage._loadBack
Barry A. Warsaw
barry@zope.com
Fri, 1 Nov 2002 11:12:23 -0500
>>>>> "TD" == Toby Dickenson <tdickenson@geminidataloggers.com> writes:
>> Do you have this as KeyError in DirectoryStorage, Toby?
TD> Yes.
TD> (a change commited this morning makes it a
TD> POSGeorgeBailedKeyError, which derives from POSKeyError.)
Actually, this opens up an interesting question for me. There are
lots of places where you might get some flavor of KeyError, but
exactly which flavor is undetermined. For example, do a load() with
an invalid oid.
In the Berkeley storages, I simply let KeyErrors that the underlying
library might raise percolate up. And in loading a GBO, I simply
raise a KeyError.
I think in general, raising any error derived from KeyError is
probably fine, but I think applications should be prepared to catch
just KeyError for maximum portability between storages.
-Barry