Skip to content

Commit

Permalink
update errors to have real stack tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
Iris-TheRainbow authored Sep 17, 2024
1 parent 543a0dd commit 08ec85d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions REVHubInterface/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,27 @@
import tkinter as tk, tkinter.ttk, tkinter.filedialog, tkinter.messagebox, os, subprocess, time, platform
import os
import datetime
import traceback

# try:
# import ft232
# except Exception as e:
# 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)


Expand Down

0 comments on commit 08ec85d

Please sign in to comment.