Improve handling for exceptions, output more information so we can find and fix problems.

This commit is contained in:
Ebag333
2017-02-12 13:09:26 -08:00
parent e7a5cb4b1d
commit 35e330f574
12 changed files with 50 additions and 33 deletions

View File

@@ -73,13 +73,15 @@ class ShipBrowserWorkerThread(threading.Thread):
cache[id_] = set_
wx.CallAfter(callback, (id_, set_))
except:
pyfalog.debug("Callback failed.")
except Exception as e:
pyfalog.critical("Callback failed.")
pyfalog.critical(e)
finally:
try:
queue.task_done()
except:
pyfalog.debug("Queue task done failed.")
except Exception as e:
pyfalog.critical("Queue task done failed.")
pyfalog.critical(e)
class PriceWorkerThread(threading.Thread):
@@ -835,8 +837,9 @@ class Market(object):
def cb():
try:
callback(requests)
except Exception:
pyfalog.debug("Callback failed.")
except Exception as e:
pyfalog.critical("Callback failed.")
pyfalog.critical(e)
eos.db.commit()
self.priceWorkerThread.trigger(requests, cb)
@@ -851,8 +854,9 @@ class Market(object):
def cb():
try:
callback(item)
except:
pyfalog.debug("Callback failed.")
except Exception as e:
pyfalog.critical("Callback failed.")
pyfalog.critical(e)
self.priceWorkerThread.setToWait(item.ID, cb)

View File

@@ -166,8 +166,9 @@ class Port(object):
fits += fitsImport
except xml.parsers.expat.ExpatError:
return False, "Malformed XML in %s" % path
except Exception:
pyfalog.exception("Unknown exception processing: %s", path)
except Exception as e:
pyfalog.critical("Unknown exception processing: %s", path)
pyfalog.critical(e)
return False, "Unknown Error while processing %s" % path
IDs = []