Print full connection exception in case of failure in debug mode

This commit is contained in:
DarkPhoenix
2019-05-28 16:03:25 +03:00
parent ff34865067
commit 6580734dc7
2 changed files with 19 additions and 9 deletions

View File

@@ -18,6 +18,7 @@
# =============================================================================
import re
import traceback
import roman
# noinspection PyPackageRequirements
@@ -31,6 +32,7 @@ from logbook import Logger
from wx.dataview import TreeListCtrl
from wx.lib.agw.floatspin import FloatSpin
import config
import gui.globalEvents as GE
from gui.bitmap_loader import BitmapLoader
from gui.builtinViews.entityEditor import BaseValidator, EntityEditor, TextEntryValidatedDialog
@@ -876,9 +878,11 @@ class APIView(wx.Panel):
def __fetchCallback(self, e=None):
if e:
exc_type, exc_obj, exc_trace = e
pyfalog.warn("Error fetching skill information for character")
pyfalog.warn(exc_obj)
pyfalog.warn("Error fetching skill information for character for __fetchCallback")
exc_type, exc_value, exc_trace = e
if config.debug:
exc_value = ''.join(traceback.format_exception(exc_type, exc_value, exc_trace))
pyfalog.warn(exc_value)
wx.MessageBox(
"Error fetching skill information",

View File

@@ -17,17 +17,21 @@
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
# =============================================================================
import traceback
# noinspection PyPackageRequirements
import wx
from gui.bitmap_loader import BitmapLoader
from logbook import Logger
import config
import gui.globalEvents as GE
import gui.mainFrame
from gui.bitmap_loader import BitmapLoader
from gui.utils.clipboard import toClipboard
from service.character import Character
from service.fit import Fit
from gui.utils.clipboard import toClipboard
pyfalog = Logger(__name__)
@@ -159,9 +163,11 @@ class CharacterSelection(wx.Panel):
if e is None:
self.refreshCharacterList()
else:
exc_type, exc_obj, exc_trace = e
pyfalog.warn("Error fetching skill information for character")
pyfalog.warn(exc_obj)
pyfalog.warn("Error fetching skill information for character for refreshAPICallback")
exc_type, exc_value, exc_trace = e
if config.debug:
exc_value = ''.join(traceback.format_exception(exc_type, exc_value, exc_trace))
pyfalog.warn(exc_value)
wx.MessageBox(
"Error fetching skill information",