Skip to content

Commit 8f703d7

Browse files
committed
Only catch argparse exceptions on startup (Fixes #236)
1 parent 77e1cae commit 8f703d7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Kapowarr.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,13 @@ def Kapowarr() -> int:
187187
db_folder=db_folder
188188
)
189189

190-
except ValueError:
191-
parser.error("The value for -d/--DatabaseFolder is not a folder")
190+
except ValueError as e:
191+
if e.args and e.args[0] == 'Database location is not a folder':
192+
parser.error(
193+
"The value for -d/--DatabaseFolder is not a folder"
194+
)
195+
else:
196+
raise e
192197

193198
else:
194199
rc = Kapowarr()

backend/internals/db.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def set_db_location(
169169

170170
if db_folder:
171171
if exists(db_folder) and not isdir(db_folder):
172-
raise ValueError
172+
raise ValueError('Database location is not a folder')
173173

174174
db_file_location = join(
175175
db_folder or folder_path(*Constants.DB_FOLDER),

0 commit comments

Comments
 (0)