Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worker raises instead of exit with error #84

Open
alexandrevicenzi opened this issue Nov 22, 2018 · 0 comments
Open

Worker raises instead of exit with error #84

alexandrevicenzi opened this issue Nov 22, 2018 · 0 comments

Comments

@alexandrevicenzi
Copy link
Contributor

Function main_loop has this code:

try:
    log_file = conf.get("LOG_FILE", None)
    logger = logging.Logger("TaskManager")
    logger.setLevel(logging.DEBUG)
    if log_file:
        log_level = logging._levelNames.get(conf.get("LOG_LEVEL", "DEBUG").upper())
        kobo.log.add_rotating_file_logger(logger, log_file, log_level=log_level)

    tm = TaskManager(conf=conf, logger=logger)
except Exception as ex:
    raise
    sys.stderr.write("Error initializing TaskManager: %s\n" % ex)
    sys.exit(1)

If some exception occurs it's re-raised instead of executing the code above the raise line. This code is unreachable and it's difficult to know what should be the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant