From 6580734dc7f000a5c5e552a71719a766f57d90b3 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Tue, 28 May 2019 16:03:25 +0300 Subject: [PATCH] Print full connection exception in case of failure in debug mode --- gui/characterEditor.py | 10 +++++++--- gui/characterSelection.py | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 1f46f429f..dc0e71428 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -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", diff --git a/gui/characterSelection.py b/gui/characterSelection.py index 051ce69b4..da75ef87f 100644 --- a/gui/characterSelection.py +++ b/gui/characterSelection.py @@ -17,17 +17,21 @@ # along with pyfa. If not, see . # ============================================================================= + +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",