From 87ecdb0ef99481f1024f99b41a5577122375d53a Mon Sep 17 00:00:00 2001 From: NecronomiconCoding Date: Sun, 31 Jul 2016 15:40:50 +0200 Subject: [PATCH] should catch accesstoken now --- PoGo.NecroBot.Logic/State/LoginState.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/PoGo.NecroBot.Logic/State/LoginState.cs b/PoGo.NecroBot.Logic/State/LoginState.cs index c01919cbc..e36562808 100644 --- a/PoGo.NecroBot.Logic/State/LoginState.cs +++ b/PoGo.NecroBot.Logic/State/LoginState.cs @@ -68,6 +68,19 @@ public async Task Execute(ISession session, CancellationToken cancellati await Task.Delay(20000, cancellationToken); return this; } + catch (AccessTokenExpiredException) + { + session.EventDispatcher.Send(new ErrorEvent + { + Message = session.Translation.GetTranslation(TranslationString.PtcOffline) // use ptcoffline for now. + }); + session.EventDispatcher.Send(new NoticeEvent + { + Message = session.Translation.GetTranslation(TranslationString.TryingAgainIn, 20) + }); + await Task.Delay(20000, cancellationToken); + return this; + } catch (AccountNotVerifiedException) { session.EventDispatcher.Send(new ErrorEvent