#NEWLINE# def _handle_error_response( self , response ) : #NEWLINE# #INDENT# if ( response . status_code == 400 ) : #NEWLINE# #INDENT# raise XeroBadRequest ( response ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( response . status_code == 401 ) : #NEWLINE# #INDENT# raise XeroUnauthorized ( response ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( response . status_code == 403 ) : #NEWLINE# #INDENT# raise XeroForbidden ( response ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . status_code == 404 ) : #NEWLINE# #INDENT# raise XeroNotFound ( response ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( response . status_code == 500 ) : #NEWLINE# #INDENT# raise XeroInternalError ( response ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( response . status_code == 501 ) : #NEWLINE# #INDENT# raise XeroNotImplemented ( response ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( response . status_code == 503 ) : #NEWLINE# #INDENT# payload = parse_qs ( response . text ) #NEWLINE# if payload : #NEWLINE# #INDENT# raise XeroRateLimitExceeded ( response , payload ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise XeroNotAvailable ( response ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise XeroExceptionUnknown ( response )