Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanlister committed Jun 9, 2015
1 parent 887c9d0 commit 5eaf4ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xero/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ def __init__(self, response):
for elem in data['Elements']
for err in elem['ValidationErrors']
]
self.problem = self.errors[0]
super(XeroBadRequest, self).__init__(response, msg=msg)

elif response.headers['content-type'].startswith('text/html'):
payload = parse_qs(response.text)
self.errors = [
payload['oauth_problem'][0],
]
self.problem = self.errors[0]
super(XeroBadRequest, self).__init__(response, payload['oauth_problem_advice'][0])

else:
Expand All @@ -43,6 +45,7 @@ def __init__(self, response):
self.errors = [
m.childNodes[0].data for m in messages[1:]
]
self.problem = self.errors[0]
super(XeroBadRequest, self).__init__(response, msg)


Expand Down

0 comments on commit 5eaf4ed

Please sign in to comment.