mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2025-12-13 14:01:13 +00:00
Handle FileNotFoundError
I'm guessing watchdog's behaviour changed in an update, as the error thrown when the watched directory doesn't exist is now "FileNotFoundError" instead of "NotADirectoryError". It'll handle either one now.
This commit is contained in:
@@ -19,7 +19,8 @@ class Watcher:
|
|||||||
self.observer.schedule(event_handler, self.dir, recursive=True)
|
self.observer.schedule(event_handler, self.dir, recursive=True)
|
||||||
try:
|
try:
|
||||||
self.observer.start()
|
self.observer.start()
|
||||||
except NotADirectoryError:
|
except (NotADirectoryError,
|
||||||
|
FileNotFoundError):
|
||||||
log.error(f"Directory {self.dir} does not exist")
|
log.error(f"Directory {self.dir} does not exist")
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user