[ZODB-Dev] zodb wants to import my module?

Christian Robottom Reis kiko at async.com.br
Wed Nov 17 14:50:25 EST 2004


On Thu, Nov 11, 2004 at 11:04:18AM -0500, Tim Peters wrote:
> > I've been confused in the past trying to track down if the
> > exception was raised in the server or in the client, and the fact that
> > it's sooo conveniently transparent is actually inconvenient here.
> >
> > I think this would reduce the confusion here, at least.
> 
> I have only vague understanding of some ZEO details.  I guess, but don't
> know, that server-side exceptions are (re)raised on the client in this bit
> of ClientStorage.py, in method _check_serials():
> 
>             for oid, s in r:
>                 if isinstance(s, Exception):
>                     raise s
>                 self._seriald[oid] = s
> 
> It's probably crucial to raise the same specific exception as was raised on
> the server (for example, app code may be trying to catch ConflictError
> specifically, and would break if that were changed to, e.g.,
> PropagatedZEOServerError).  If we can't change the exception raised, then
> there's no general way to sneak new info into the message produced by a
> given exception (that message is generated by the exception's __str__
> method, which may be anything).

How about printing a message to stderr just before raising the
exception? No, because you don't want to be console-printing stuff since
there's a chance the exception is going to be handled gracefully. Oh,
this is so annoying!

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331


More information about the ZODB-Dev mailing list