From e0aef6f8afda7bbab85d7d3d1930a4110ae1e852 Mon Sep 17 00:00:00 2001 From: h Date: Sun, 19 Mar 2023 16:08:44 +0800 Subject: [PATCH] Check whether the file exists, do not report a bunch of exceptions --- book_maker/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/book_maker/cli.py b/book_maker/cli.py index 4d38475..91f8ea7 100644 --- a/book_maker/cli.py +++ b/book_maker/cli.py @@ -190,6 +190,11 @@ So you are close to reaching the limit. You have to choose your own value, there ) options = parser.parse_args() + + if not os.path.isfile(options.book_name): + print(f"Error: {options.book_name} does not exist.") + exit(1) + PROXY = options.proxy if PROXY != "": os.environ["http_proxy"] = PROXY