aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-02-27 06:31:30 +0800
committerGitHub <noreply@github.com>2024-02-26 22:31:30 +0000
commiteb2fc1818b00b7ca6f8c21bb490a8e8be1e62f9a (patch)
tree449c0659eb24037fe0f5b9c801b7e873ae43a7d3 /modules
parent4f70ebb68494b23c5bce93efbe4c5f80b3aaf444 (diff)
downloadgitea-eb2fc1818b00b7ca6f8c21bb490a8e8be1e62f9a.tar.gz
gitea-eb2fc1818b00b7ca6f8c21bb490a8e8be1e62f9a.zip
Fix mail template error (#29410)
Diffstat (limited to 'modules')
-rw-r--r--modules/templates/mailer.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/templates/mailer.go b/modules/templates/mailer.go
index 54d857a8f6..04032e3982 100644
--- a/modules/templates/mailer.go
+++ b/modules/templates/mailer.go
@@ -44,11 +44,17 @@ func buildSubjectBodyTemplate(stpl *texttmpl.Template, btpl *template.Template,
}
if _, err := stpl.New(name).
Parse(string(subjectContent)); err != nil {
- log.Warn("Failed to parse template [%s/subject]: %v", name, err)
+ log.Error("Failed to parse template [%s/subject]: %v", name, err)
+ if !setting.IsProd {
+ log.Fatal("Please fix the mail template error")
+ }
}
if _, err := btpl.New(name).
Parse(string(bodyContent)); err != nil {
- log.Warn("Failed to parse template [%s/body]: %v", name, err)
+ log.Error("Failed to parse template [%s/body]: %v", name, err)
+ if !setting.IsProd {
+ log.Fatal("Please fix the mail template error")
+ }
}
}