diff --git a/src/ytdl_sub/main.py b/src/ytdl_sub/main.py index 73fb04fb..e8f7e147 100644 --- a/src/ytdl_sub/main.py +++ b/src/ytdl_sub/main.py @@ -32,11 +32,11 @@ def main(): sys.exit(1) except Exception: # pylint: disable=broad-except logger.exception("An uncaught error occurred:") - logger.error("Version: %s", __version__) logger.error( - "Please upload the error log file '%s' and make a Github " + "Version %s\nPlease upload the error log file '%s' and make a Github " "issue at https://github.com/jmbannon/ytdl-sub/issues with your config and " "command/subscription yaml file to reproduce. Thanks for trying ytdl-sub!", + __version__, Logger.debug_log_filename(), ) sys.exit(1) diff --git a/tests/unit/main/test_main.py b/tests/unit/main/test_main.py index c1c91bfd..cdc17022 100644 --- a/tests/unit/main/test_main.py +++ b/tests/unit/main/test_main.py @@ -5,6 +5,7 @@ from unittest.mock import patch import pytest +from src.ytdl_sub import __version__ from src.ytdl_sub.main import main from ytdl_sub.utils.exceptions import ValidationException from ytdl_sub.utils.logger import Logger @@ -13,7 +14,7 @@ from ytdl_sub.utils.logger import Logger @pytest.fixture def expected_uncaught_error_message(): return ( - f"Please upload the error log file '%s' and make a " + f"Version %s\nPlease upload the error log file '%s' and make a " f"Github issue at https://github.com/jmbannon/ytdl-sub/issues with your config and " f"command/subscription yaml file to reproduce. Thanks for trying ytdl-sub!" ) @@ -63,4 +64,5 @@ def test_main_uncaught_error(capsys, mock_sys_exit, expected_uncaught_error_mess assert mock_error.call_count == 1 assert mock_error.call_args.args[0] == expected_uncaught_error_message - assert mock_error.call_args.args[1] == Logger.debug_log_filename() + assert mock_error.call_args.args[1] == __version__ + assert mock_error.call_args.args[2] == Logger.debug_log_filename()