log unhandle exception
This commit is contained in:
@@ -101,3 +101,5 @@ Failed to decode QRCode=无法解析二维码
|
||||
Failed to update registry=无法修改注册表
|
||||
System Proxy On: =系统代理已启用:
|
||||
Running: Port {0}=正在运行:端口 {0}
|
||||
Unexpect error, shadowsocks will be exit. Please report to=非预期错误,Shadowsocks将退出。请提交此错误到
|
||||
|
||||
@@ -55,12 +55,18 @@ namespace Shadowsocks
|
||||
}
|
||||
}
|
||||
|
||||
private static int exited = 0;
|
||||
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
Logging.Error(e.ExceptionObject?.ToString());
|
||||
MessageBox.Show($"Unexpect error, shadowsocks exited.{Environment.NewLine} {e.ExceptionObject?.ToString()}",
|
||||
"Shadowsocks", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
if (Interlocked.Increment(ref exited) == 1)
|
||||
{
|
||||
Logging.Error(e.ExceptionObject?.ToString());
|
||||
MessageBox.Show(I18N.GetString("Unexpect error, shadowsocks will be exit. Please report to") +
|
||||
" https://github.com/shadowsocks/shadowsocks-windows/issues " +
|
||||
Environment.NewLine + (e.ExceptionObject?.ToString()),
|
||||
"Shadowsocks Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user