This commit is contained in:
BruceChen 2022-08-28 17:14:28 +08:00
parent 75e7b0e37d
commit 003c4c3ab8

View file

@ -311,8 +311,17 @@ namespace MinecraftClient
// Try to refresh access token
if (!string.IsNullOrWhiteSpace(session.RefreshToken))
{
result = ProtocolHandler.MicrosoftLoginRefresh(session.RefreshToken, out session);
try
{
result = ProtocolHandler.MicrosoftLoginRefresh(session.RefreshToken, out session);
}
catch (Exception ex)
{
ConsoleIO.WriteLine("Refresh access token fail: " + ex.Message);
result = ProtocolHandler.LoginResult.InvalidResponse;
}
}
if (result != ProtocolHandler.LoginResult.Success
&& Settings.Password == ""
&& Settings.AccountType == ProtocolHandler.AccountType.Mojang)