From c79d28668ec0595fa9ab2d7e591c640bd5e6c8af Mon Sep 17 00:00:00 2001 From: Alex Kanitz Date: Tue, 5 Sep 2023 20:36:19 +0200 Subject: [PATCH] fix: change exit code for unexpected errors --- htsinfer/cli.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htsinfer/cli.py b/htsinfer/cli.py index 99cb9ad6..3fea80d4 100644 --- a/htsinfer/cli.py +++ b/htsinfer/cli.py @@ -4,6 +4,7 @@ import argparse import logging from pathlib import Path +from traceback import format_exc from typing import Dict import signal import sys @@ -331,6 +332,11 @@ def main() -> None: LOGGER.error('Execution interrupted.') sys.exit(128 + signal.SIGINT) + except Exception as exc: # pylint: disable=W0703 + LOGGER.error(f"{exc}") + LOGGER.debug(format_exc()) + sys.exit(2) + # conclude execution LOGGER.info("Done") sys.exit(hts_infer.state.value)