def circuit_failed(self, circuit, **kw): "ICircuitListener API" txtorlog.msg("circuit_failed", circuit, str(kw)) circuit._when_built.fire( Failure( CircuitBuildFailedError(_extract_reason(kw)) ) ) self.circuit_destroy(circuit)