Skip to content

Commit

Permalink
better crash handler for ElevenClock
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Jul 6, 2023
1 parent d7ea818 commit 3560505
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions elevenclock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import pytz
from threading import Thread
from urllib.request import urlopen

try:
import psutil
importedPsutil = True
Expand Down Expand Up @@ -1878,9 +1878,15 @@ def window(self) -> Clock:
app.quit()
app.exec()
app.quit()

except FileNotFoundError as e:
sys.exit(402)
except (ModuleNotFoundError, ImportError) as e:
import traceback
import win32api
tb = traceback.format_exception(*sys.exc_info())
tracebacc = ""
for line in tb: tracebacc += line+"\n"
win32api.MessageBox(None, "Your ElevenClock installation appears to have missing or corrupt components. Please reinstall ElevenClock.\n\n"+tracebacc, "ElevenClock Crash handler", 0x00000010)
except Exception as e:
import webbrowser, traceback, platform
if not "versionName" in locals() and not "versionName" in _globals():
Expand Down

0 comments on commit 3560505

Please sign in to comment.