mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Nicer error message when user tries to use a directory as log file
This commit is contained in:
parent
d9c997087e
commit
893b72f0ab
@ -190,6 +190,10 @@ def main(args=sys.argv):
|
||||
raise SystemExit(e.message)
|
||||
opts.auto_reload_port = int(os.environ.get('CALIBRE_AUTORELOAD_PORT', 0))
|
||||
opts.allow_console_print = 'CALIBRE_ALLOW_CONSOLE_PRINT' in os.environ
|
||||
if opts.log and os.path.isdir(opts.log):
|
||||
raise SystemExit('The --log option must point to a file, not a directory')
|
||||
if opts.access_log and os.path.isdir(opts.access_log):
|
||||
raise SystemExit('The --access-log option must point to a file, not a directory')
|
||||
server = Server(libraries, opts)
|
||||
if getattr(opts, 'daemonize', False):
|
||||
if not opts.log and not iswindows:
|
||||
|
Loading…
x
Reference in New Issue
Block a user