OSDN Git Service

例外が発生したときにエラーメッセージを表示する
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Fri, 1 Jan 2016 02:23:56 +0000 (11:23 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Fri, 1 Jan 2016 02:25:37 +0000 (11:25 +0900)
KancolleSniffer/MainForm.cs

index 2431199..3f6a0a7 100644 (file)
@@ -27,7 +27,6 @@ using System.Text.RegularExpressions;
 using System.Threading;\r
 using System.Threading.Tasks;\r
 using System.Windows.Forms;\r
-using System.Xml;\r
 using Microsoft.CSharp.RuntimeBinder;\r
 using Microsoft.Win32;\r
 using static System.Math;\r
@@ -123,10 +122,6 @@ namespace KancolleSniffer
             {\r
                 ShowServerError(url, request, response, e);\r
             }\r
-            catch (XmlException e)\r
-            {\r
-                ShowServerError(url, request, response, e);\r
-            }\r
             catch (RuntimeBinderException e)\r
             {\r
                 if (_errorDialog.ShowDialog(this,\r
@@ -138,6 +133,11 @@ namespace KancolleSniffer
                 if (_errorDialog.ShowDialog(this, e.Message, e.InnerException.ToString()) == DialogResult.Abort)\r
                     Application.Exit();\r
             }\r
+            catch (Exception e)\r
+            {\r
+                if (_errorDialog.ShowDialog(this, "エラーが発生しました。", e.ToString()) == DialogResult.Abort)\r
+                    Application.Exit();\r
+            }\r
         }\r
 \r
         private void WriteDebugLog(string url, string request, string response)\r