From a3739f67f77309c134d94b7e4f0b6173a1c9a0f5 Mon Sep 17 00:00:00 2001 From: "1808837298@qq.com" <1808837298@qq.com> Date: Thu, 6 Mar 2025 17:25:39 +0800 Subject: [PATCH] fix: Handle error in NotifyRootUser and log system errors #812 --- service/user_notify.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/user_notify.go b/service/user_notify.go index db291f0f..51f1ff99 100644 --- a/service/user_notify.go +++ b/service/user_notify.go @@ -11,7 +11,10 @@ import ( func NotifyRootUser(t string, subject string, content string) { user := model.GetRootUser().ToBaseUser() - _ = NotifyUser(user.Id, user.Email, user.GetSetting(), dto.NewNotify(t, subject, content, nil)) + err := NotifyUser(user.Id, user.Email, user.GetSetting(), dto.NewNotify(t, subject, content, nil)) + if err != nil { + common.SysError(fmt.Sprintf("failed to notify root user: %s", err.Error())) + } } func NotifyUser(userId int, userEmail string, userSetting map[string]interface{}, data dto.Notify) error {