Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
Add detailed error report
Browse files Browse the repository at this point in the history
  • Loading branch information
derekhe committed Nov 11, 2021
1 parent bff7ecd commit b85b3f0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ def create_help(self, parent):
command=lambda: webbrowser.open("https://github.com/derekhe/msfs2020-google-map/issues")).grid(
column=2, row=row, sticky=(W, E))

row += 1
ttk.Label(parent, text="Please setup proxy if your access to google is blocked", background="#f1e740").grid(
column=1, row=row, sticky=(W, E), columnspan=2)

for child in parent.winfo_children():
child.grid_configure(padx=5, pady=5)

Expand Down Expand Up @@ -232,7 +236,7 @@ def run(self):
add_cert()
except:
traceback.print_exc()
messagebox.showerror(message="Add certificate failed")
messagebox.showerror(message=f"Add certificate failed: {traceback.format_exc()}")
return

try:
Expand All @@ -243,16 +247,18 @@ def run(self):

with open("./nginx/conf/nginx.conf", "wt") as out:
out.write(output)
except:
except Exception as ex:
traceback.print_exc()
messagebox.showerror(message="Generate nginx file failed")
messagebox.showerror(message=f"Generate nginx file failed:\n {traceback.format_exc()}")
return

try:
override_hosts()
except:
traceback.print_exc()
messagebox.showerror(message="Override hosts failed")
messagebox.showerror(
message=f"Override hosts failed, please try delete the C:\\Windows\\System32\\drivers\\etc\\hosts file, backup it first. Details:\n{traceback.format_exc()}")
os.startfile("C:\\Windows\\System32\\drivers\\etc")
return

try:
Expand All @@ -264,7 +270,7 @@ def run(self):
"nginx.exe", shell=True, cwd="./nginx")
except:
traceback.print_exc()
messagebox.showerror(message="Unable to start nginx")
messagebox.showerror(message=f"Unable to start nginx:\n{traceback.format_exc()}")
return

Thread(target=self.health_check_thread).start()
Expand Down

0 comments on commit b85b3f0

Please sign in to comment.