mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-25 01:11:39 +00:00
Nuke catch and silent_catch decorators from orbit
This commit is contained in:
parent
3ec71e89d6
commit
8b1c0bd1e4
3 changed files with 9 additions and 41 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue