diff --git a/src/XIVLauncher.Core/Components/MainPage/MainPage.cs b/src/XIVLauncher.Core/Components/MainPage/MainPage.cs index fa7280ad..69806061 100644 --- a/src/XIVLauncher.Core/Components/MainPage/MainPage.cs +++ b/src/XIVLauncher.Core/Components/MainPage/MainPage.cs @@ -245,14 +245,18 @@ public async Task Login(string username, string password, bool isOtp, bool private async Task 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); } /* @@ -276,7 +280,7 @@ private async Task 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) @@ -298,7 +302,7 @@ private async Task 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)