[Twisted-Python] Re: [Twisted-commits] Accumulated Woven Changes::

Andrew Bennetts andrew-twisted at puzzling.org
Mon Oct 14 20:09:20 EDT 2002


On Mon, Oct 14, 2002 at 02:39:10PM -0500, Glyph Lefkowitz wrote:
> 
> On Tue, 15 Oct 2002 02:31:56 +1000, Andrew Bennetts
> <andrew-twisted at puzzling.org> wrote:
> > This makes me wonder if most of the time you want to add a callback
> > and an errback, you want the errback to be able to catch the
> > callbacks errors.
> 
> I originally experimented with it that way, and I like it better the
> way it is.  For example, in the case of a remote method call, you use
> addCallbacks if you want to handle the remote call by saying "Here is
> the result: ..." or "Remote traceback: ..."  It's really misleading to
> have the "remote traceback" message happen in the case where the
> traceback is really local.  Worse yet is to have a situation where
> it's acceptable to swallow any remote error, but a local error is
> unexpected.  Since the default behavior should be to print out a
> traceback in the log, naive use of addCallbacks will do the right
> thing.

Good point.  I am convinced.

After all, a more accurate picture of my mini try/except in my last
email really should've been:
    try:
        res = call_that_may_take_some_time()
    except Failure, f:
        eb(f)
    else:
        cb(res)

-Andrew.





More information about the Twisted-Python mailing list