[Twisted-Python] FirstError handling from defer.gatherResults()?
I'm missing something obvious, so I must consult the gurus of the list: I have some code that gets info from remote devices, a little like this: def get_thing_info(): dlist = [] for thing in thinglist: d = thing.fetch_info() dlist.append(d) return defer.gatherResults(dlist) If an error occurs, gatherResults() behaves like DeferredList(fireOnOneErrback=True), but the errback will receive a FirstError object, not a Failure. Normally, I'd do something like this in an Errback: def cb_handle_failure(failure): e = failure.trap(MyNonFatalException) if e: log.debug("Not a fatal failure. Getting info again.") return get_thing_info() But what is the right way to do this when I receive a FirstError? -- Justin Warren <daedalus@eigenmagic.com>
participants (1)
-
Justin Warren