aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-03-09 11:20:42 +0200
committerFilipp Lepalaan <f@230.to>2013-03-09 11:20:42 +0200
commit4625aeb30e634db03ffb9f485a7fc275d0288454 (patch)
treed80076d18a4466159e6100d0ab29d35430b5e95a
parent54854c07225c2b1cde75963df462b3fb5164088c (diff)
downloadpy-gsxws-4625aeb30e634db03ffb9f485a7fc275d0288454.tar.gz
py-gsxws-4625aeb30e634db03ffb9f485a7fc275d0288454.tar.bz2
py-gsxws-4625aeb30e634db03ffb9f485a7fc275d0288454.zip
Raise GsxError on authentication failure
-rwxr-xr-xgsxws.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/gsxws.py b/gsxws.py
index a7dad00..53c2813 100755
--- a/gsxws.py
+++ b/gsxws.py
@@ -717,10 +717,12 @@ def connect(
account.userTimeZone = timezone
account.serviceAccountNo = sold_to
- result = CLIENT.service.Authenticate(account)
- SESSION['userSessionId'] = result.userSessionId
-
- return SESSION
+ try:
+ result = CLIENT.service.Authenticate(account)
+ SESSION['userSessionId'] = result.userSessionId
+ return SESSION
+ except suds.WebFault, e:
+ raise GsxError(code=e.fault.faultcode, message=e.fault.faultstring)
def logout():
CLIENT.service.Logout()