Skip to content

Commit ff14f93

Browse files
committed
[app] Show error message on startup failure due to config load errors #241
1 parent 5a402be commit ff14f93

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

docs/changelog.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,9 @@ This version of DVR-Scan includes a new, faster background subtraction algorithm
391391

392392
### 1.8.2
393393

394-
* [general] Minimum Python version is now 3.10 ([EOL](https://devguide.python.org/versions/))
395-
* [bugfix] Fix `quiet-mode` setting (`-q`/`--quiet` flag) still allowing extraneous output
396-
* [bugfix] Fix loading config from file in UI ([#253](https://github.com/Breakthrough/DVR-Scan/issues/253))
397-
* [bugfix] Fix scan error when enabling "Use PTS" input option with multiple videos ([#254](https://github.com/Breakthrough/DVR-Scan/issues/254))
394+
* [general] Minimum supported Python version is now 3.10 (Python 3.9 is [EOL](https://devguide.python.org/versions/))
395+
* [general] An error is now displayed when launching the app fails due to an invalid config file [#241](https://github.com/Breakthrough/DVR-Scan/issues/241)
396+
* [bugfix] Fix `quiet-mode` setting (`-q`/`--quiet` flag) still allowing extraneous output [#243](https://github.com/Breakthrough/DVR-Scan/issues/243)
397+
* [bugfix] Fix loading config from file in UI [#253](https://github.com/Breakthrough/DVR-Scan/issues/253)
398+
* [bugfix] Fix scan error when enabling "Use PTS" input option with multiple videos [#254](https://github.com/Breakthrough/DVR-Scan/issues/254)
398399
* [bugfix] Fix unchecked UI options being turned on in config files [#256](https://github.com/Breakthrough/DVR-Scan/issues/256)

dvr_scan/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import sys
3636

3737
# Used for module/distribution identification.
38-
__version__ = "1.9-dev0"
38+
__version__ = "1.8.2-dev0"
3939

4040
# Handle loading OpenCV. This **MUST** be first before any other DVR-Scan or third-party
4141
# packages are imported which might attempt to import the `cv2` module.

dvr_scan/app/__main__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import logging
1414
import sys
1515
from subprocess import CalledProcessError
16+
import tkinter
17+
import tkinter.messagebox
1618

1719
from scenedetect import VideoOpenFailure
1820

@@ -176,6 +178,11 @@ def main():
176178
logger.debug("Error loading config file:", exc_info=config_load_error)
177179
# Intentionally suppress the exception in release mode since we've already logged the
178180
# failure reason to the user above. We can now exit with an error code.
181+
errors = [message for (severity, message) in init_log if severity >= logging.ERROR]
182+
tkinter.messagebox.showerror(
183+
title="DVR-Scan Startup Error",
184+
message=f"Error loading config file. Reason:\n\n{'\n'.join(errors)}",
185+
)
179186
raise SystemExit(1)
180187

181188
show_traceback = getattr(logging, settings.get("verbosity").upper()) == logging.DEBUG

0 commit comments

Comments
 (0)