Skip to content

Instantly share code, notes, and snippets.

@igniteflow
Created September 23, 2011 13:59
Show Gist options
  • Save igniteflow/1237404 to your computer and use it in GitHub Desktop.
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
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