From 7eb140a0306aec6e046779410718ab36d5d18eeb Mon Sep 17 00:00:00 2001 From: ww-rm Date: Mon, 3 Nov 2025 18:13:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E6=8A=A5=E9=94=99=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpineViewer/App.xaml.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SpineViewer/App.xaml.cs b/SpineViewer/App.xaml.cs index f8d57b0..f121b0c 100644 --- a/SpineViewer/App.xaml.cs +++ b/SpineViewer/App.xaml.cs @@ -2,6 +2,7 @@ using NLog; using SpineViewer.Natives; using SpineViewer.Resources; +using SpineViewer.Services; using SpineViewer.ViewModels.MainWindow; using SpineViewer.Views; using System.Collections.Frozen; @@ -58,13 +59,16 @@ namespace SpineViewer AppDomain.CurrentDomain.UnhandledException += (s, e) => { + _logger.Debug(e.ExceptionObject.ToString()); _logger.Fatal("Unhandled exception: {0}", e.ExceptionObject); + MessagePopupService.Error(e.ExceptionObject.ToString()); }; TaskScheduler.UnobservedTaskException += (s, e) => { _logger.Debug(e.Exception.ToString()); - _logger.Error("Unobserved task exception: {0}", e.Exception.Message); + _logger.Fatal("Unobserved task exception: {0}", e.Exception.Message); e.SetObserved(); + MessagePopupService.Error(e.Exception.ToString()); }; // 单例模式加 IPC 通信 @@ -213,8 +217,9 @@ namespace SpineViewer private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { _logger.Debug(e.Exception.ToString()); - _logger.Error("Dispatcher unhandled exception: {0}", e.Exception.Message); + _logger.Fatal("Dispatcher unhandled exception: {0}", e.Exception.Message); e.Handled = true; + MessagePopupService.Error(e.Exception.ToString()); } public bool AutoRun