Add status messages back to ESI fitting export (#1502)
This commit is contained in:
@@ -243,28 +243,30 @@ class ExportToEve(wx.Frame):
|
||||
self.statusbar.SetStatusText("Sending request and awaiting response", 1)
|
||||
sEsi = Esi.getInstance()
|
||||
|
||||
sFit = Fit.getInstance()
|
||||
data = sPort.exportESI(sFit.getFit(fitID))
|
||||
res = sEsi.postFitting(self.getActiveCharacter(), data)
|
||||
|
||||
try:
|
||||
sFit = Fit.getInstance()
|
||||
data = sPort.exportESI(sFit.getFit(fitID))
|
||||
res = sEsi.postFitting(self.getActiveCharacter(), data)
|
||||
res.raise_for_status()
|
||||
self.statusbar.SetStatusText("", 0)
|
||||
self.statusbar.SetStatusText("", 1)
|
||||
# try:
|
||||
# text = json.loads(res.text)
|
||||
# self.statusbar.SetStatusText(text['message'], 1)
|
||||
# except ValueError:
|
||||
# pyfalog.warning("Value error on loading JSON.")
|
||||
# self.statusbar.SetStatusText("", 1)
|
||||
self.statusbar.SetStatusText(res.reason, 1)
|
||||
except requests.exceptions.ConnectionError:
|
||||
msg = "Connection error, please check your internet connection"
|
||||
pyfalog.error(msg)
|
||||
self.statusbar.SetStatusText(msg)
|
||||
self.statusbar.SetStatusText("ERROR", 0)
|
||||
self.statusbar.SetStatusText(msg, 1)
|
||||
except ESIExportException as ex:
|
||||
pyfalog.error(ex)
|
||||
self.statusbar.SetStatusText("ERROR", 0)
|
||||
self.statusbar.SetStatusText(ex.args[0], 1)
|
||||
self.statusbar.SetStatusText("{} - {}".format(res.status_code, res.reason), 1)
|
||||
except APIException as ex:
|
||||
ESIExceptionHandler(self, ex)
|
||||
try:
|
||||
ESIExceptionHandler(self, ex)
|
||||
except Exception as ex:
|
||||
self.statusbar.SetStatusText("ERROR", 0)
|
||||
self.statusbar.SetStatusText("{} - {}".format(res.status_code, res.reason), 1)
|
||||
pyfalog.error(ex)
|
||||
|
||||
|
||||
class SsoCharacterMgmt(wx.Dialog):
|
||||
|
||||
@@ -96,7 +96,7 @@ class Esi(EsiAccess):
|
||||
# @todo: new fitting ID can be recovered from resp.data,
|
||||
char = self.getSsoCharacter(id)
|
||||
resp = super().postFitting(char, json_str)
|
||||
return resp.json()
|
||||
return resp
|
||||
|
||||
def delFitting(self, id, fittingID):
|
||||
char = self.getSsoCharacter(id)
|
||||
|
||||
Reference in New Issue
Block a user