Commit 20287d0f authored by BorjaEst's avatar BorjaEst
Browse files

Add util return_on_failure to log instead of break

parent ede8445d
......@@ -21,6 +21,20 @@ def cd(newdir):
logger.debug("Restore directory: '%s'", prevdir)
def return_on_failure(message):
"""Decorator to do not break but log"""
def decorate(function):
def applicator(*args, **kwargs):
function(*args, **kwargs)
# Log error with stak using root (not utils)
logging.error(message, exc_info=True)
return applicator
return decorate
def load(yaml_file):
"""Loads the .yaml file with the sources configurations"""
with open(yaml_file, "r") as ymlfile:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment