Skip to content

Instantly share code, notes, and snippets.

@bluepnume
Created September 29, 2016 01:32
Show Gist options
  • Select an option

  • Save bluepnume/be77466529bc7bb1819353df773d5037 to your computer and use it in GitHub Desktop.

Select an option

Save bluepnume/be77466529bc7bb1819353df773d5037 to your computer and use it in GitHub Desktop.
# put this at the top of your file
def warnjilly(method):
def wrapper(*args, **kwargs):
try:
return method(*args, **kwargs)
except Exception, e:
print '!!!! Oh no jilly, something went wrong !!!!'
print e
return wrapper
# then add it to any function or method you want to check for errors
class Something(object):
@warnjilly
def doSomething(self):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment