#NEWLINE# def _genericErrback( self , error , url , method = 'GET' , headers = None , postdata = None , count = 0 ) : #NEWLINE# #INDENT# if ( headers is None ) : #NEWLINE# #INDENT# headers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# if ( 'status' in error . value . __dict__ ) : #NEWLINE# #INDENT# if ( int ( error . value . status ) == 204 ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# 'response' : error . value . response , #NEWLINE# 'status' : int ( error . value . status ) , #NEWLINE# 'headers' : error . value . response , #NEWLINE# 'message' : error . value . headers , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( int ( error . value . status ) not in self . ACCEPTABLE_ERROR_CODES ) and ( count < 3 ) ) : #NEWLINE# #INDENT# d = self . rq . getPage ( url , method = method , headers = headers , postdata = postdata ) #NEWLINE# d . addErrback ( self . _genericErrback , url , method = method , headers = headers , postdata = postdata , count = ( count + 1 ) ) #NEWLINE# return d #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return error #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return error