aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rwxr-xr-xgsxws.py17
2 files changed, 13 insertions, 6 deletions
diff --git a/README.md b/README.md
index e6ae8bc..3db385b 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Currently it supports most of them.
Installation:
- pip install -e git+git://github.com/filipp/py-gsxws.git#egg=gsxws
+ pip install -U -e git+git://github.com/filipp/py-gsxws.git#egg=gsxws
It goes a little something like this:
diff --git a/gsxws.py b/gsxws.py
index 1eb404d..0685c62 100755
--- a/gsxws.py
+++ b/gsxws.py
@@ -326,10 +326,14 @@ class GsxResponse(dict):
return nodedict
class GsxError(Exception):
- def __init__(self, message, code=None):
- self.code = code
- self.message = message
- self.data = (self.code, self.message)
+ def __init__(self, message=None, code=None, fault=None):
+ if isinstance(fault, suds.WebFault):
+ self.code = fault.fault.faultcode
+ self.message=fault.fault.faultstring
+ else:
+ self.code = code
+ self.message = message
+ self.data = (self.code, self.message)
def __getitem__(self, idx):
return self.data[idx]
@@ -602,7 +606,10 @@ class Repair(GsxObject):
dt.repairConfirmationNumbers = [self.data['dispatchId']]
result = CLIENT.service.MarkRepairComplete(dt)
- return result.repairConfirmationNumbers
+ try:
+ return result.repairConfirmationNumbers
+ except suds.WebFault, e:
+ raise GsxError(fault=e)
def delete(self):
"""