From c18cbe5e59493fbf910f69c842ce5171845499fb Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 24 Oct 2021 14:30:52 -0400 Subject: [PATCH] Handle server timeouts gracefully --- gui/esiFittings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gui/esiFittings.py b/gui/esiFittings.py index f5cbd1591..08c7936fc 100644 --- a/gui/esiFittings.py +++ b/gui/esiFittings.py @@ -242,6 +242,16 @@ class ESIExceptionHandler: SsoCharacterMgmt.openOne(parent=gui.mainFrame.MainFrame.getInstance()) # todo: spawn manage esi characters pass + elif ex.response['error'].startswith('Timeout contacting'): + pyfalog.error(ex) + with wx.MessageDialog( + gui.mainFrame.MainFrame.getInstance(), + "HTTP %s: %s\n\n" % (ex.status_code, ex.response['error']) + + _t("The server took too long to response. Please try again in a moment."), + _t("Timeout"), + wx.OK | wx.ICON_ERROR + ) as dlg: + dlg.ShowModal() else: # We don't know how to handle the error, raise it for the global error handler to pick it up raise ex