From abefe21796251db02bb125ca265f600de178a7a5 Mon Sep 17 00:00:00 2001 From: WatchMeCalculate Date: Tue, 5 Jun 2018 23:42:00 -0700 Subject: [PATCH] Adds exception handler for when HttpServer fails on init --- gui/esiFittings.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/gui/esiFittings.py b/gui/esiFittings.py index 99d8f33eb..af3da77a5 100644 --- a/gui/esiFittings.py +++ b/gui/esiFittings.py @@ -157,6 +157,19 @@ class EveFittings(wx.Frame): self.statusbar.SetStatusText(msg) +class ESIServerExceptionHandler(object): + def __init__(self, parentWindow, ex): + dlg = wx.MessageDialog(parentWindow, + "There was an issue starting up the localized server, try setting " + "Login Authentication Method to Manual by going to Preferences -> EVE SS0 -> " + "Login Authentication Method. If this doesn't fix the problem please file an " + "issue on Github.", + "Add Character Error", + wx.OK | wx.ICON_ERROR) + dlg.ShowModal() + pyfalog.error(ex) + + class ESIExceptionHandler(object): # todo: make this a generate excetpion handler for all calls def __init__(self, parentWindow, ex): @@ -325,10 +338,12 @@ class SsoCharacterMgmt(wx.Dialog): self.lcCharacters.SetColumnWidth(0, wx.LIST_AUTOSIZE) self.lcCharacters.SetColumnWidth(1, wx.LIST_AUTOSIZE) - @staticmethod - def addChar(event): - sEsi = Esi.getInstance() - sEsi.login() + def addChar(self, event): + try: + sEsi = Esi.getInstance() + sEsi.login() + except Exception as ex: + ESIServerExceptionHandler(self, ex) def delChar(self, event): item = self.lcCharacters.GetFirstSelected()