473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Re: [Twisted-Python] Counting errors in a DeferredList and avoidingUnhandled error in Deferred messages

On Mon, 5 May 2008 19:10:39 +0200, Terry Jones <te***@jon.eswrote:
>If I pass a list of deferreds to DeferredList and want to add a callback to
the DeferredList to look at whatever errors have occurred in the underlying
deferreds, should I do something like this:

deferreds = []
for x in whatever:
deferreds.append(funcReturningDeferred(x))

dl = DeferredList(deferreds)
dl.addCallback(errorCheckingFunc)

for d in deferreds:
d.addErrback(lambda _: pass)
This ensures that errorCheckingFunc gets defer.FAILURE for those deferreds
that finished up in their errback chain. Adding the lambda _: pass errback
to each deferred in deferreds after it has been passed to DeferredList
makes sure the errback chain doesn't later reach its end with an unhandled
error.

It that the right/best/approved way to handle needing to deal with errors
in the callback of a DeferredList and not trigger the "Unhandled error in
Deferred" message?
You can do this (if you replace `pass´ with `None´, anyway) or you can
pass `consumeErrors=True´ to the `DeferredList´ initializer which will
make it do something equivalent.

Jean-Paul
Jun 27 '08 #1
0 923

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark Carter | last post by:
I'm trying to create a mail server in Twisted. I either get SMTPSenderRefused or SMTPException: SMTP AUTH extension not supported by server. What do I need to do to get it to work?
11
by: mir nazim | last post by:
hi, i m planning to start writing intranet applications and want ur real cool advices for choosing the correct platform. the choice is between the three: 1. Twisted 2. Medusa 3. Zope (i do...
3
by: Rico Huijbers | last post by:
Does anybody have experience in writing Jabber clients with Twisted? I came across a simple sample, and tried to build out from it, but for some reason it's barely working. When I run the...
0
by: Willy | last post by:
Hi, I just started learning twisted and hit a big problem. How do I debug my twisted server? I wrote a test tcp server called 'tcpserver.py' using twisted.application method. I start to debug...
2
by: Taki Jeden | last post by:
Hi Anybody used wxPython with twisted? I started putting together a Twisted-based app with wx GUI, and the widgets just don't work - some controls do not show up etc. - at least on my system....
13
by: Charlotte | last post by:
I am developing a web application and am looking for the best framework to do this in. I know this is an old question, and I have read the list archives and a couple of comparison pages on the web....
2
by: Christopher Subich | last post by:
I'm building an application that makes several user-specified internet connections; twisted meets my needs more or less perfectly. I'm running into a problem, however, in that twisted is not...
0
by: Matthew Warren | last post by:
Looking through those docs quickly leads me into quite a bewildering maze. As a kind of way to perhaps get me heading in the right direction and understanding how I start to hang all that...
1
by: sndive | last post by:
i have a lot of trouble selling twisted a a client lib for network access (on embedded platform) the group i'm a member of wants to write some unmaintainable threaded blocking junk in c--. does...
0
by: Stodge | last post by:
I'm trying to get a simple multicast application working using Twisted; so far I have: from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.