Skip to content

Commit

Permalink
Merge pull request #176 from rankynbass/fix-Unknown-error
Browse files Browse the repository at this point in the history
  • Loading branch information
reiichi001 authored Aug 31, 2024
2 parents eb052e8 + 6903fb9 commit 56cbeca
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/XIVLauncher.Core/Components/MainPage/MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,18 @@ public async Task<bool> Login(string username, string password, bool isOtp, bool

private async Task<bool> TryProcessLoginResult(Launcher.LoginResult loginResult, bool isSteam, LoginAction action)
{
// Format error message in the way OauthLoginException expects.
var preErrorMsg = "window.external.user(\"login=auth,ng,err,";
var postErrorMsg = "\");";

if (loginResult.State == Launcher.LoginState.NoService)
{
throw new OauthLoginException("No service account or subscription");
throw new OauthLoginException(preErrorMsg + "No service account or subscription" + postErrorMsg);
}

if (loginResult.State == Launcher.LoginState.NoTerms)
{
throw new OauthLoginException("Need to accept terms of use");
throw new OauthLoginException(preErrorMsg + "Need to accept terms of use" + postErrorMsg);
}

/*
Expand All @@ -276,7 +280,7 @@ private async Task<bool> TryProcessLoginResult(Launcher.LoginResult loginResult,
"Error", MessageBoxButton.OK, MessageBoxImage.Error, parentWindow: _window);
*/

throw new OauthLoginException("Boot conflict, need reinstall");
throw new OauthLoginException(preErrorMsg + "Boot conflict, need reinstall" + postErrorMsg);
}

if (action == LoginAction.Repair)
Expand All @@ -298,7 +302,7 @@ private async Task<bool> TryProcessLoginResult(Launcher.LoginResult loginResult,
"The server sent an incorrect response - the repair cannot proceed."),
"Error", MessageBoxButton.OK, MessageBoxImage.Error, parentWindow: _window);
*/
throw new OauthLoginException("Repair login state not NeedsPatchGame");
throw new OauthLoginException(preErrorMsg + "Repair login state not NeedsPatchGame" + postErrorMsg);
}
}
catch (Exception)
Expand Down

0 comments on commit 56cbeca

Please sign in to comment.