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

Add exception message to the failed update prompt. #188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion SS14.Launcher/Assets/Locale/en-US/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ connecting-title-connecting = Connecting…
connecting-title-content-bundle = Loading…
connecting-cancel = Cancel
connecting-status-none = Starting connection…
connecting-status-update-error = There was an error while downloading server content. Please ask on Discord for support if the problem persists.
connecting-status-update-error =
There was an error while downloading server content. Please ask on Discord for support if the problem persists.

Technical error: { $err }
connecting-status-updating = Updating: { $status }
connecting-status-connecting = Fetching connection info from server…
connecting-status-connection-failed = Failed to connect to server!
Expand Down
3 changes: 3 additions & 0 deletions SS14.Launcher/Models/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
private readonly HttpClient _http;
private bool _updating;

public Updater()

Check warning on line 56 in SS14.Launcher/Models/Updater.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'ExceptionMessage' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 56 in SS14.Launcher/Models/Updater.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field 'ExceptionMessage' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
_cfg = Locator.Current.GetRequiredService<DataManager>();
_engineManager = Locator.Current.GetRequiredService<IEngineManager>();
Expand Down Expand Up @@ -103,6 +103,7 @@
catch (Exception e)
{
Status = UpdateStatus.Error;
ExceptionMessage = e.Message;
Log.Error(e, "Exception while trying to run updates");
}
finally
Expand Down Expand Up @@ -1444,6 +1445,8 @@
public bool MultiWindow = false;
}

public string ExceptionMessage;

public enum UpdateStatus
{
CheckingClientUpdate,
Expand Down
3 changes: 2 additions & 1 deletion SS14.Launcher/ViewModels/ConnectingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ public string SpeedText
_connectorStatus switch
{
Connector.ConnectionStatus.None => _loc.GetString("connecting-status-none") + _reasonSuffix,
Connector.ConnectionStatus.UpdateError => _loc.GetString("connecting-status-update-error"),
Connector.ConnectionStatus.UpdateError => _loc.GetString("connecting-status-update-error",
("err", _updater.ExceptionMessage)),
Connector.ConnectionStatus.Updating => _loc.GetString("connecting-status-updating", ("status", _loc.GetString(_updaterStatus switch
{
Updater.UpdateStatus.CheckingClientUpdate => "connecting-update-status-checking-client-update",
Expand Down
Loading