Avoid crash if not provide book_name (#431)

This commit is contained in:
Xie Yanbo 2024-11-06 17:57:38 +08:00 committed by GitHub
parent 78fc7985d5
commit 546fbd8e37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -333,8 +333,11 @@ So you are close to reaching the limit. You have to choose your own value, there
options = parser.parse_args()
if not options.book_name:
print(f"Error: please provide the path of your book using --book_name <path>")
exit(1)
if not os.path.isfile(options.book_name):
print(f"Error: {options.book_name} does not exist.")
print(f"Error: the book {options.book_name!r} does not exist.")
exit(1)
PROXY = options.proxy