From 08ec85d19037257d8edeee9dfee799b72cb5a3ec Mon Sep 17 00:00:00 2001 From: Iris <87090296+Iris-TheRainbow@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:15:44 -0500 Subject: [PATCH] update errors to have real stack tracing --- REVHubInterface/__main__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/REVHubInterface/__main__.py b/REVHubInterface/__main__.py index 527c3ca..ee111de 100644 --- a/REVHubInterface/__main__.py +++ b/REVHubInterface/__main__.py @@ -8,6 +8,7 @@ import tkinter as tk, tkinter.ttk, tkinter.filedialog, tkinter.messagebox, os, subprocess, time, platform import os import datetime +import traceback # try: # import ft232 @@ -15,15 +16,19 @@ # print(platform.system) # tkinter.messagebox.showerror('Drivers Not Detected', 'Please verify the correct drivers are installed. Without the correct dirvers, firmware update functionality will be unavailable.\n\n - Windows 10 and above should automatically install the correct drivers when the Expansion Hub is plugged in.\n\n - Windows 7 requires a manual install. Please see this link for the correct driver (FTDI D2xx): https://www.ftdichip.com/Drivers/CDM/CDM21228_Setup.zip\n\n - On macOS, install libftdi via Homebrew: "brew install libftdi"\n\n - On Linux, install libftdi. On Debian/Ubuntu-based systems, install it via "sudo apt install libftdi1"\n\nException Message:\n' + str(e)) def error(windowName: str, error: Exception) -> None: - err = str(error) + errName = str(error) + print(errName) + err = str(traceback.format_exc()) print(err) - tkinter.messagebox.showerror(windowName, err) + tkinter.messagebox.showerror(windowName, errName) now = datetime.datetime.now() with open(os.path.expanduser("~") + "/.REVHubInterface/errorlog.txt", "a") as f: f.write(now.strftime("%d/%m/%Y %H:%M:%S")) f.write("\n") f.write(windowName) f.write("\n") + f.write(errName) + f.write("\n") f.write(err)