Skip to content
Browse files

remove traceback from expected Faults

  • Loading branch information...
1 parent d58a5ba commit aed12e0139519ccdda099a6fb4c44929c4caf09d @baverman committed Mar 28, 2012
Showing with 6 additions and 8 deletions.
  1. +4 −7 dropthesoap/service.py
  2. +2 −1 tests/test_service.py
View
11 dropthesoap/service.py
@@ -191,14 +191,11 @@ def call(self, transport_request, xml):
ctx = Request(transport_request, envelope)
response = self.dispatch(ctx, request)
+ except Fault as e:
+ response = soap.Fault.instance(faultcode=e.code, faultstring=str(e))
except Exception as e:
- faultcode = 'Server'
- if isinstance(e, Fault):
- faultcode = e.code
- else:
- logger.exception('Exception during soap request:')
-
- response = soap.Fault.instance(faultcode=faultcode, faultstring=str(e),
+ logger.exception('Exception during soap request:')
+ response = soap.Fault.instance(faultcode='Server', faultstring=str(e),
detail=traceback.format_exc())
renvelope = soap.Envelope.instance(Body=soap.Body.instance(_any=[response]))
View
3 tests/test_service.py
@@ -124,4 +124,5 @@ def upper(string=xs.string):
assert False, 'WebFault must be thrown'
except WebFault as e:
assert e.fault.faultcode == 'Client.Auth'
- assert e.fault.faultstring == 'Authentication failed'
+ assert e.fault.faultstring == 'Authentication failed'
+ assert not hasattr(e, 'detail')

0 comments on commit aed12e0

Please sign in to comment.
Something went wrong with that request. Please try again.