将Catch块中 打印Log的全部替换为NotificationHelper.ShowError

This commit is contained in:
2025-07-06 15:15:38 +08:00
parent 533a49d47b
commit b0874a4f02
8 changed files with 175 additions and 31 deletions

View File

@@ -70,8 +70,7 @@ public partial class MqttsViewModel : ViewModelBase
}
catch (Exception e)
{
NotificationHelper.ShowMessage($"添加MQTT的过程中发生错误{e.Message}", NotificationType.Error);
_logger.LogError($"添加MQTT的过程中发生错误{e}");
NotificationHelper.ShowError($"添加MQTT的过程中发生错误{e.Message}", e);
}
}
@@ -98,8 +97,7 @@ public partial class MqttsViewModel : ViewModelBase
}
catch (Exception e)
{
NotificationHelper.ShowMessage($"删除MQTT的过程中发生错误{e.Message}", NotificationType.Error);
_logger.LogError($"删除MQTT的过程中发生错误{e}");
NotificationHelper.ShowError($"删除MQTT的过程中发生错误{e.Message}", e);
}
}
@@ -123,8 +121,7 @@ public partial class MqttsViewModel : ViewModelBase
}
catch (Exception e)
{
NotificationHelper.ShowMessage($"编辑MQTT的过程中发生错误{e.Message}", NotificationType.Error);
_logger.LogError($"编辑MQTT的过程中发生错误{e}");
NotificationHelper.ShowError($"编辑MQTT的过程中发生错误{e.Message}", e);
}
}