From ecfdf4a47beb94f90a91e0ccac25d95b5c5f3cbb Mon Sep 17 00:00:00 2001 From: pg9182 <96569817+pg9182@users.noreply.github.com> Date: Thu, 20 Apr 2023 18:22:54 -0400 Subject: Improve server connection error messages (#598) * Also show masterserver error for server connections It's already used for self auth and is available for both, but we currently only show it for the former. * Don't localize server connection errors It never fully worked, and it's more useful to have non-localized detailed error messages. * Don't prepend NS_SERVERBROWSER_CONNECTIONFAILED to server conn err msg The message always contains something like it, and it's always right after a connectiom anyways. * NSGetAuthFailReason always returns a string, so don't make it untyped --- Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 4 +++- Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'Northstar.Client/mod') diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index b2e2a8b6..b663a25a 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -1085,9 +1085,11 @@ void function ThreadedAuthAndConnectToServer( string password = "" ) } else { + string reason = NSGetAuthFailReason() + DialogData dialogData dialogData.header = "#ERROR" - dialogData.message = "Authentication Failed" + dialogData.message = reason dialogData.image = $"ui/menu/common/dialog_error" #if PC_PROG diff --git a/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut b/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut index 95b7bdae..53d85387 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut @@ -571,12 +571,12 @@ void function TryAuthWithLocalServer() { CloseAllDialogs() - var reason = NSGetAuthFailReason() + string reason = NSGetAuthFailReason() DialogData dialogData dialogData.image = $"ui/menu/common/dialog_error" dialogData.header = "#ERROR" - dialogData.message = Localize("#NS_SERVERBROWSER_CONNECTIONFAILED") + "\nERROR: " + reason + "\n" + Localize("#" + reason) + dialogData.message = reason AddDialogButton( dialogData, "#OK", null ) OpenDialog( dialogData ) -- cgit v1.2.3