(c *gin.Context, errCode int)
| 174 | } |
| 175 | |
| 176 | func (resp *defaultResponse) isUserDefinedHTTPErrorCode(c *gin.Context, errCode int) bool { |
| 177 | if v, ok := resp.httpErrors[errCode]; ok { |
| 178 | httpCode := v.ToHTTPCode() |
| 179 | msg := http.StatusText(httpCode) |
| 180 | if msg == "" { |
| 181 | msg = "unknown error" |
| 182 | } |
| 183 | resp.response(c, httpCode, httpCode, msg, struct{}{}) |
| 184 | return true |
| 185 | } |
| 186 | return false |
| 187 | } |
| 188 | |
| 189 | // ToHTTPErr converted to http error |
| 190 | func ToHTTPErr(st *status.Status) *Error { //nolint |
no test coverage detected