1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-26 20:23:53 +00:00

RetryMiddleware: added ConnectionLost to retried exceptions

twisted >8.0 has a ConnectionClosed exception parent of ConnectionLost
and ConnectionDone, but twisted 2.5 hasn't.

I add ConnectionLost until we can move forward to twisted >8.0

this is the docstring of ConnectionLost, hopes it is self explanatory:
    """Connection to the other side was lost in a non-clean fashion"""

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40757
This commit is contained in:
Daniel Grana 2009-01-22 03:19:53 +00:00
parent bef1fa967a
commit 8ff4dc4d02

View File

@ -25,7 +25,8 @@ About HTTP errors to consider:
"""
from twisted.internet.error import TimeoutError as ServerTimeoutError, DNSLookupError, \
ConnectionRefusedError, ConnectionDone, ConnectError
ConnectionRefusedError, ConnectionDone, ConnectError, \
ConnectionLost
from twisted.internet.defer import TimeoutError as UserTimeoutError
from scrapy import log
@ -36,7 +37,8 @@ from scrapy.conf import settings
class RetryMiddleware(object):
EXCEPTIONS_TO_RETRY = (ServerTimeoutError, UserTimeoutError, DNSLookupError,
ConnectionRefusedError, ConnectionDone, ConnectError)
ConnectionRefusedError, ConnectionDone, ConnectError,
ConnectionLost)
def __init__(self):
self.failed_count = {}