python decorator for error handling
def safe_run(func):
def func_wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception as e:
print(e)
return None
return func_wrapper