Skip to content

Commit a576f41

Browse files
committed
improving error handling
1 parent 81c13fc commit a576f41

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

quickbooks/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,11 @@ def make_request(self, request_type, url, request_body=None, content_type='appli
206206
except:
207207
raise QuickbooksException("Error reading json response: {0}".format(req.text), 10000)
208208

209-
if req.status_code is not httplib.OK or "Fault" in result:
209+
if "Fault" in result:
210210
self.handle_exceptions(result["Fault"])
211+
elif not req.status_code == httplib.OK:
212+
raise QuickbooksException("Error returned with status code '{0}': {1}".format(
213+
req.status_code, req.text), 10000)
211214
else:
212215
return result
213216

0 commit comments

Comments
 (0)