Why is Twisted Manhole ConnectionDone a bug?

I am using a twisted hatch (https://github.com/HoverHell/pyaux/blob/master/pyaux/runlib.py#L126) and also posting errors found by Twisted in the python protocol (https://github.com/HoverHell /pyaux/blob/master/pyaux/twisted_aux.py#L9).

However, as a result, the log gets errors ConnectionDone()

, which is not very interesting as an error.

What would be appropriate to change to avoid getting (and perhaps some others) inaccurate errors? Maybe filtering for cases twisted.python.failure.Failure

? And where from ConnectionDone () even raised and why?

+3


source to share


1 answer


A ConnectionDone () instance is assigned to the connectLost () callback after the connection has been closed. You should see this when the client side decides to close the connection. You definitely don't want to filter the Disclaimer. You can think of error as the "asynchronous analogy" of Exception. It is a common thing not to see any exceptions, it is something like:



from twisted.internet import error

...

def connectionLost(self, reason):
    if reason.check(error.ConnectionDone):
        # this is normal, ignore this
        pass
    else:
        # do whatever you have been doing for logging

      

+7


source







All Articles