def handleError(): from twisted.python import failure global exitStatus exitStatus = 2 try: reactor.stop() except: pass log.err(failure.Failure()) raise