From 4af3c4c9eaa3eda45dcfe410c4ff93d36fcda2cc Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby Date: Thu, 6 Mar 2025 09:18:04 +0100 Subject: [PATCH] Fix #7 with exception handler. --- View/mainwindow.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/View/mainwindow.py b/View/mainwindow.py index dcdfc4f..2e159bb 100644 --- a/View/mainwindow.py +++ b/View/mainwindow.py @@ -275,7 +275,15 @@ class Ui_MainWindow(object): cc_kt.exec() def db_browser_for_sqlite(self): - Popen(f"sqlitebrowser", shell=True) + try: + Popen("sqlitebrowser") + except OSError as e: + msg_box = QtWidgets.QMessageBox() + msg_box.setWindowTitle("DB Browser for SQLite Error") + msg_box.setIcon(QtWidgets.QMessageBox.Critical) + msg_box.setText(f"DB Browser for SQLite Error:\n {str(e)}") + msg_box.setStandardButtons(QtWidgets.QMessageBox.Ok) + msg_box.exec() def about_window(self): print("about")