#NEWLINE# def _execute_task( self , attempts , last_error = '' ) : #NEWLINE# #INDENT# if ( attempts == 0 ) : #NEWLINE# #INDENT# self . _queue_print_message ( self . filename , failed = True , dryrun = self . parameters [ 'dryrun' ] , error_message = last_error ) #NEWLINE# return #NEWLINE# #UNINDENT# filename = self . filename #NEWLINE# kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if self . payload : #NEWLINE# #INDENT# kwargs [ 'payload' ] = self . payload #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# if ( not connect_error . parameters [ 'dryrun' ] ) : #NEWLINE# #INDENT# getattr ( filename , filename . operation_name ) ( ** kwargs ) #NEWLINE# #UNINDENT# #UNINDENT# except requests . ConnectionError as e : #NEWLINE# #INDENT# connect_error = str ( e ) #NEWLINE# LOGGER . debug ( '%s %s failure: %s' , filename . src , filename . operation_name , connect_error ) #NEWLINE# self . _execute_task ( ( attempts - 1 ) , last_error = str ( e ) ) #NEWLINE# #UNINDENT# except MD5Error as e : #NEWLINE# #INDENT# LOGGER . debug ( '%s %s failure: Data was corrupted: %s' , filename . src , filename . operation_name , e ) #NEWLINE# self . _execute_task ( ( attempts - 1 ) , last_error = str ( e ) ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# LOGGER . debug ( str ( e ) , exc_info = True ) #NEWLINE# self . _queue_print_message ( filename , failed = True , dryrun = self . parameters [ 'dryrun' ] , error_message = str ( e ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _queue_print_message ( filename , failed = False , dryrun = self . parameters [ 'dryrun' ] )