re thorw exception in wrapper

This commit is contained in:
shaun 2016-11-01 10:54:38 +11:00
parent 590c3ef4c3
commit 066ec81e16
3 changed files with 5 additions and 5 deletions

View file

@ -22,7 +22,7 @@ ga = GoogleAnalytics()
##################################################################################################
def catch_except(errors=(Exception, ), default_value=False):
def catch_except(errors=(Exception, )):
# Will wrap method with try/except and print parameters for easier debugging
def decorator(func):
def wrapper(*args, **kwargs):
@ -34,7 +34,7 @@ def catch_except(errors=(Exception, ), default_value=False):
log.exception(error)
log.error("function: %s \n args: %s \n kwargs: %s",
func.__name__, args, kwargs)
return default_value
raise
return wrapper
return decorator