提交 ab4fa15f 编写于 作者: Sliver_Horn's avatar Sliver_Horn

修改ErrorToEmail中间件的请求方式错误

上级 2ed73cae
......@@ -42,7 +42,7 @@ func ErrorToEmail() gin.HandlerFunc {
latency := time.Now().Sub(now)
status := c.Writer.Status()
record.ErrorMessage = c.Errors.ByType(gin.ErrorTypePrivate).String()
str := "接收到的请求为" + record.Body + "\n" + "请求方式为" + record.Path + "\n" + "报错信息如下" + record.ErrorMessage + "\n" + "耗时" + latency.String() + "\n"
str := "接收到的请求为" + record.Body + "\n" + "请求方式为" + record.Method + "\n" + "报错信息如下" + record.ErrorMessage + "\n" + "耗时" + latency.String() + "\n"
if global.GVA_CONFIG.System.ErrorToEmail {
if status != 200 {
subject := username + "" +record.Ip + "调用了" + record.Path + "报错了"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册