Handle OSError when creating download directory

Fixes #2570

(cherry picked from commit 7ed71592e0)
This commit is contained in:
Florian Bruhin 2018-08-07 16:40:46 +02:00
parent bb8901f48f
commit 4efb19dc76
1 changed files with 4 additions and 1 deletions

View File

@ -79,7 +79,10 @@ def download_dir():
else:
ddir = directory
os.makedirs(ddir, exist_ok=True)
try:
os.makedirs(ddir, exist_ok=True)
except OSError as e:
message.error("Failed to create download directory: {}".format(e))
return ddir