From 18a653380c34496b137b61a9587479213f55741b Mon Sep 17 00:00:00 2001 From: Regalis11 Date: Fri, 16 Oct 2015 23:37:57 +0300 Subject: [PATCH] More launcher error checking --- Launcher2/LauncherMain.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Launcher2/LauncherMain.cs b/Launcher2/LauncherMain.cs index cc822c818..595dbadc4 100644 --- a/Launcher2/LauncherMain.cs +++ b/Launcher2/LauncherMain.cs @@ -335,6 +335,8 @@ namespace Launcher2 return false; } + if (doc == null) return false; + CheckUpdateXML(doc); return true; @@ -348,8 +350,14 @@ namespace Launcher2 IRestResponse response = client.Execute(request); - if (response.ResponseStatus != ResponseStatus.Completed) return null; - if (response.StatusCode != HttpStatusCode.OK) return null; + if (response.ResponseStatus != ResponseStatus.Completed) + { + throw new Exception("Couldn't connect to update server"); + } + if (response.StatusCode != HttpStatusCode.OK) + { + throw new Exception("Couldn't connect to update server ("+response.StatusCode+")"); + } string xml = response.Content; @@ -542,7 +550,7 @@ namespace Launcher2 { if (e.Error!=null) { - string errorMsg = "Error while downloading: " + e.Error.InnerException.Message; + string errorMsg = "Error while downloading: " + e.Error; GUITextBlock textBlock = new GUITextBlock( new Rectangle(0, 0, 0, 0),