}\r
catch (RuntimeBinderException e)\r
{\r
- WriteErrorLog(url, request, response, e.ToString());\r
if (_errorDialog.ShowDialog(this,\r
- "艦これに仕様変更があったか、受信内容が壊れています。", e.ToString()) == DialogResult.Abort)\r
+ "艦これに仕様変更があったか、受信内容が壊れています。",\r
+ GenerateErrorLog(url, request, response, e.ToString())) == DialogResult.Abort)\r
Application.Exit();\r
}\r
catch (LogIOException e)\r
}\r
catch (Exception e)\r
{\r
- WriteErrorLog(url, request, response, e.ToString());\r
- if (_errorDialog.ShowDialog(this, "エラーが発生しました。", e.ToString()) == DialogResult.Abort)\r
+ if (_errorDialog.ShowDialog(this, "エラーが発生しました。",\r
+ GenerateErrorLog(url, request, response, e.ToString())) == DialogResult.Abort)\r
Application.Exit();\r
}\r
}\r
\r
- private void WriteErrorLog(string url, string request, string response, string exception)\r
+ private string GenerateErrorLog(string url, string request, string response, string exception)\r
{\r
RemoveSensitiveInformation(ref request, ref response);\r
var version = string.Join(".", Application.ProductVersion.Split('.').Take(2));\r
- File.AppendAllText("error.log",\r
- $"{DateTime.Now:g} {version}\r\n{exception}\r\n{url}\r\n{request}\r\n{response}\r\n\r\n");\r
+ return $"{DateTime.Now:g} {version}\r\n{exception}\r\n{url}\r\n{request}\r\n{response}\r\n";\r
}\r
\r
private void RemoveSensitiveInformation(ref string request, ref string response)\r