[Python-Dev] Re: PEP 282 comments

Guido van Rossum guido@python.org
Wed, 20 Mar 2002 20:57:41 -0500


> ZEO is a component that lets clients on remote machines
> access a ZODB storage using a custon Python RMI.  (The
> details aren't exactly important, except that it's a
> concrete example.)  IOW, ZEO + ZODB is a client-server
> object database.
> 
> It's possible for all sorts of things to go wrong for an
> individual RMI.  There can be a problem marshalling or
> unmarshalling the objects.  There can be a problem with
> executing the actual methods on the server.  There can be a
> problem with application code that is executed as a result
> of calling some method on the server.  Etc.
> 
> Few of these errors are fatal.  Some of them may be
> uninteresting most of the time.  So I'd like to log
> tracebacks and vary the log level depending on the
> importance of the event that caused the exception.
> 
> One particular example is a KeyError.  The server will raise
> a KeyError if the client asks for an object that doesn't
> exist.  There are clients that catch this error on the
> client side and handle it cleanly.  It's not an important
> exception for them.  But I'd like to log the traceback on
> the server to handle cases where the client isn't expecting
> it.  I'd probably log this at debug() level.  Most of the
> time, nobody cares about a KeyError.  But it might
> occasionally be useful when debugging something.

If this use case is rare enough, maybe a better approach would be to
let you format it yourself using the traceback module?

--Guido van Rossum (home page: http://www.python.org/~guido/)