#NEWLINE# def log_error( self , error ) : #NEWLINE# #INDENT# "Log and append errors to object\n\n        This does a check to see if response object available from HTTP\n        request. If not, that's OK too and it'll just append the raw error.\n        " #NEWLINE# if ( hasattr ( error , 'response' ) and hasattr ( error . response , 'json' ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# meta = error . response . json ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# meta = error . response #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# meta = error #NEWLINE# #UNINDENT# self . logger . debug ( ( '[%s] %s' % ( self . identifier , meta ) ) , exc_info = True ) #NEWLINE# self . logger . warning ( ( '[%s] %s' % ( self . identifier , error ) ) ) #NEWLINE# self . errors . append ( meta ) #NEWLINE# self . last_error = meta