Skip to content

Instantly share code, notes, and snippets.

@mehmetsefabalik
Created February 18, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mehmetsefabalik/c4c7e8b4c53903950f2223eb51ffb2ec to your computer and use it in GitHub Desktop.
Save mehmetsefabalik/c4c7e8b4c53903950f2223eb51ffb2ec to your computer and use it in GitHub Desktop.
def log_on_exception(tag1, tag2):
def deco(func):
def wrapper(*args, **kwargs):
try:
result = func(*args, **kwargs)
except exception as err:
logger(err, tag1, tag2)
else:
return result
return wrapper
return deco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment