未捕获异常不再提示

This commit is contained in:
liufei
2022-01-05 17:21:35 +08:00
parent 6038eee680
commit e9063a176e

View File

@@ -44,8 +44,11 @@ namespace GeekDesk
{ {
e.Handled = true;//使用这一行代码告诉运行时该异常被处理了不再作为UnhandledException抛出了。 e.Handled = true;//使用这一行代码告诉运行时该异常被处理了不再作为UnhandledException抛出了。
LogUtil.WriteErrorLog(e, "未捕获异常!"); LogUtil.WriteErrorLog(e, "未捕获异常!");
if (Constants.DEV)
{
MessageBox.Show("GeekDesk遇到一个问题, 不用担心, 这不影响其它操作!"); MessageBox.Show("GeekDesk遇到一个问题, 不用担心, 这不影响其它操作!");
} }
}
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{ {