Nuke catch and silent_catch decorators from orbit

This commit is contained in:
Odd Stråbø 2020-08-01 00:03:40 +02:00
parent 3ec71e89d6
commit 8b1c0bd1e4
3 changed files with 9 additions and 41 deletions

View file

@ -48,40 +48,6 @@ def progress(message=None):
return decorator
def catch(errors=(Exception,)):
''' Wrapper to catch exceptions and return using catch
'''
def decorator(func):
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except errors as error:
LOG.exception(error)
raise Exception("Caught exception")
return wrapper
return decorator
def silent_catch(errors=(Exception,)):
''' Wrapper to catch exceptions and ignore them
'''
def decorator(func):
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except errors as error:
LOG.error(error)
return wrapper
return decorator
def stop(func):
''' Wrapper to catch exceptions and return using catch