diff options
author | Filipp Lepalaan <f@230.to> | 2013-03-09 11:20:42 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-03-09 11:20:42 +0200 |
commit | 4625aeb30e634db03ffb9f485a7fc275d0288454 (patch) | |
tree | d80076d18a4466159e6100d0ab29d35430b5e95a | |
parent | 54854c07225c2b1cde75963df462b3fb5164088c (diff) | |
download | py-gsxws-4625aeb30e634db03ffb9f485a7fc275d0288454.tar.gz py-gsxws-4625aeb30e634db03ffb9f485a7fc275d0288454.tar.bz2 py-gsxws-4625aeb30e634db03ffb9f485a7fc275d0288454.zip |
Raise GsxError on authentication failure
-rwxr-xr-x | gsxws.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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() |