X Tutup
Skip to content

Commit 786d521

Browse files
authored
Merge pull request routablehq#110 from adam-pro/download-pdf-auth-error-msg-bug
Fixed bug in PDF download of lost error details on authentication failure
2 parents 4d72f41 + 50a48b0 commit 786d521

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
========
33

4+
* 0.7.5 (May 11th, 2018)
5+
* Fixed bug with reporting authentication failure when attempting to download PDF (previously the error details were "lost")
6+
47
* 0.7.4 (March 26th, 2018)
58
* Fixed bug in SendMixin send method.
69
* Added support for send_to email to SendMixin.

quickbooks/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ def download_pdf(self, qbbo, item_id):
315315
response = self.process_request("GET", url, headers=headers)
316316

317317
if response.status_code != httplib.OK:
318+
319+
if response.status_code == httplib.UNAUTHORIZED:
320+
# Note that auth errors have different result structure which can't be parsed by handle_exceptions()
321+
raise AuthorizationException("Application authentication failed", detail=response.text)
322+
318323
try:
319324
result = response.json()
320325
except:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def read(*parts):
1010
return fp.read()
1111

1212

13-
VERSION = (0, 7, 4)
13+
VERSION = (0, 7, 5)
1414
version = '.'.join(map(str, VERSION))
1515

1616
setup(

0 commit comments

Comments
 (0)
X Tutup