Commit 33988637 authored by shaw's avatar shaw
Browse files

fix: SMTP测试连接和发送测试邮件返回具体错误信息而非internal error

parent d4f6ad72
...@@ -819,7 +819,7 @@ func (h *SettingHandler) TestSMTPConnection(c *gin.Context) { ...@@ -819,7 +819,7 @@ func (h *SettingHandler) TestSMTPConnection(c *gin.Context) {
err := h.emailService.TestSMTPConnectionWithConfig(config) err := h.emailService.TestSMTPConnectionWithConfig(config)
if err != nil { if err != nil {
response.ErrorFrom(c, err) response.BadRequest(c, "SMTP connection test failed: "+err.Error())
return return
} }
...@@ -905,7 +905,7 @@ func (h *SettingHandler) SendTestEmail(c *gin.Context) { ...@@ -905,7 +905,7 @@ func (h *SettingHandler) SendTestEmail(c *gin.Context) {
` `
if err := h.emailService.SendEmailWithConfig(config, req.Email, subject, body); err != nil { if err := h.emailService.SendEmailWithConfig(config, req.Email, subject, body); err != nil {
response.ErrorFrom(c, err) response.BadRequest(c, "Failed to send test email: "+err.Error())
return return
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment