Created
September 29, 2016 01:32
-
-
Save bluepnume/be77466529bc7bb1819353df773d5037 to your computer and use it in GitHub Desktop.
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
| # 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