ErrorResp is used to return error response @param l: if true, log error
(c *gin.Context, err error, code int, l ...bool)
| 25 | // ErrorResp is used to return error response |
| 26 | // @param l: if true, log error |
| 27 | func ErrorResp(c *gin.Context, err error, code int, l ...bool) { |
| 28 | ErrorWithDataResp(c, err, code, nil, l...) |
| 29 | //if len(l) > 0 && l[0] { |
| 30 | // if flags.Debug || flags.Dev { |
| 31 | // log.Errorf("%+v", err) |
| 32 | // } else { |
| 33 | // log.Errorf("%v", err) |
| 34 | // } |
| 35 | //} |
| 36 | //c.JSON(200, Resp[interface{}]{ |
| 37 | // Code: code, |
| 38 | // Message: hidePrivacy(err.Error()), |
| 39 | // Data: nil, |
| 40 | //}) |
| 41 | //c.Abort() |
| 42 | } |
| 43 | |
| 44 | // ErrorPage is used to return error page HTML. |
| 45 | // It also returns standard HTTP status code. |
no test coverage detected