Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Unknown error" #176

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading