Created
September 23, 2011 13:59
-
-
Save igniteflow/1237404 to your computer and use it in GitHub Desktop.
An exception catcher for SOAP web service calls made with the SUDS Python library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def try_except(fn, *args): | |
""" | |
A decorator to catch suds exceptions | |
Simply add @try_except to the client call function | |
""" | |
def wrapped(*args): | |
try: | |
fn(*args) | |
except suds.WebFault as detail: | |
return detail | |
return wrapped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment