#NEWLINE# def parse_error( self ) : #NEWLINE# #INDENT# if ( self . status == httplib . UNAUTHORIZED ) : #NEWLINE# #INDENT# raise InvalidCredsError ( 'Invalid provider credentials' ) #NEWLINE# #UNINDENT# value = None #NEWLINE# body = self . parse_body ( ) #NEWLINE# if hasattr ( body , 'values' ) : #NEWLINE# #INDENT# values = list ( body . values ( ) ) [ 0 ] #NEWLINE# if ( 'errortext' in values ) : #NEWLINE# #INDENT# value = values [ 'errortext' ] #NEWLINE# #UNINDENT# #UNINDENT# if ( value is None ) : #NEWLINE# #INDENT# value = self . body #NEWLINE# #UNINDENT# if ( not value ) : #NEWLINE# #INDENT# value = 'WARNING: error message text sent by provider was empty.' #NEWLINE# #UNINDENT# error = ProviderError ( value = error , http_code = self . status , driver = self . connection . driver ) #NEWLINE# raise error