Handle server timeouts gracefully

This commit is contained in:
blitzmann
2021-10-24 14:30:52 -04:00
parent adba55eb7d
commit c18cbe5e59

View File

@@ -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