[ZODB-Dev] Inconsistent use of ConflictError
Greg Ward
gward@mems-exchange.org
Fri, 17 Aug 2001 10:07:31 -0400
On 17 August 2001, Chris McDonough said:
> This is pretty cool.. on the Zope side, we'll need to go clean up some
> places where we do dumb things (like "errorobj is ConflictError"), but
> this looks far better than what exists.
Umm, yeah, I didn't think of that. Is it OK if I restrict myself to
just the code in StandaloneZODB? I don't see how "errorobj is
ConflictError" could have possibly worked in all the days that
ConflictError has been a class, anyways.
> I wonder how to keep it this way as new storages hit the pike.
Well, it's still technically legal to
raise ConflictError, `oid`
because that's equivalent to
raise ConflictError(message=`oid`)
which would generate an error message no worse than the current code
does. It's just failing to use my pumped-up ConflictError.
However, my hunch is that 1) people likely to write new storages
probably read zodb-dev, and 2) they might actually look at the
definition of ConflictError before raising it willy-nilly. I mean,
reading a class' docstring before instantiating that class is not a
difficult concept. ;-)
Perhaps I should add a docstring to the constructor, too...
Greg
--
Greg Ward - software developer gward@mems-exchange.org
MEMS Exchange http://www.mems-exchange.org