浏览代码

Catch error when downloading install package

Eric Reed 12 年之前
父节点
当前提交
34ea03c36a
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      MediaBrowser.Installer/MainWindow.xaml.cs

+ 10 - 1
MediaBrowser.Installer/MainWindow.xaml.cs

@@ -154,8 +154,17 @@ namespace MediaBrowser.Installer
             }
 
             // Download
+            string archive = null;
             lblStatus.Content = string.Format("Downloading {0} (version {1})...", FriendlyName, version.versionStr);
-            var archive = await DownloadPackage(version);
+            try
+            {
+                archive = await DownloadPackage(version);
+            }
+            catch (Exception e)
+            {
+                SystemClose("Error Downloading Package - " + e.GetType().FullName + "\n\n" + e.Message);
+            }
+
             dlAnimation.StopAnimation();
             prgProgress.Visibility = btnCancel.Visibility = Visibility.Hidden;