#NEWLINE# def _error( self , event , reason = None ) : #NEWLINE# #INDENT# if ( self . on_error == 'tag' ) : #NEWLINE# #INDENT# event . add_tag ( 'error' ) #NEWLINE# if reason : #NEWLINE# #INDENT# event [ 'message' ] = str ( reason ) #NEWLINE# #UNINDENT# self . output . put ( event ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( reason , Exception ) : #NEWLINE# #INDENT# self . logger . exception ( ( 'ignoring %s: %s' % ( event , reason ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . logger . warn ( ( 'ignoring %s: %s' % ( event , reason ) ) )