Skip to content

Commit 56bb821

Browse files
committed
Do not fail whole app when ESI access object fails instantiation
1 parent 17f9071 commit 56bb821

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

pyfa.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,15 @@ def _process_args(self, largs, rargs, values):
151151
ErrorHandler.SetParent(mf)
152152

153153
# Start ESI token validation, this helps avoid token expiry
154-
from service.esi import Esi
155-
esi = Esi.getInstance()
156-
esi.startTokenValidation()
157-
pyfalog.info("ESI token validation started")
154+
try:
155+
from service.esi import Esi
156+
esi = Esi.getInstance()
157+
esi.startTokenValidation()
158+
pyfalog.info("ESI token validation started")
159+
except (KeyboardInterrupt, SystemExit):
160+
raise
161+
except Exception as e:
162+
pyfalog.warning(f"failed to start ESI token validation thread:\n{e}")
158163

159164
if options.profile_path:
160165
profile_path = os.path.join(options.profile_path, 'pyfa-{}.profile'.format(datetime.datetime.now().strftime('%Y%m%d_%H%M%S')))

0 commit comments

Comments
 (0)