Skip to content

Commit

Permalink
feat: add error handling and error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
itsHenry35 committed Jun 14, 2023
1 parent a136263 commit 39c823d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
20 changes: 16 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
from gui.login1_sms import login1_sms
from gui.login2_sms import login2_sms
from gui.login3 import login3
import sys, os
import sys, os, webbrowser
import platform
import tkinter.messagebox as mb
import requests
import sentry_sdk

sentry_sdk.init(
dsn="https://c25be4debe4f4a00b773850b890a4fa4@o4505250566111232.ingest.sentry.io/4505357690077184",

# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces_sample_rate=1.0
)

def set_alldata(data):
global token
Expand Down Expand Up @@ -65,5 +74,8 @@ def get_platform_info():
login()
download()
except Exception as e:
mb.showerror('错误:' + str(e))
sys.exit(1)
sentry_sdk.capture_exception(e)
mb.showerror('错误','错误:' + str(e))
mb.showinfo('错误反馈', '请在弹出的网页底部评论区中或在GitHub上将错误反馈给开发者!')
webbrowser.open("https://blog.itshenryz.com/2022/06/01/ledu-playback-download/")
sys.exit()
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ requests
tk
ttkbootstrap
pyaria2
sentry-sdk

0 comments on commit 39c823d

Please sign in to comment.