HandleUnauthorized handles unauthorized access errors
(w http.ResponseWriter, r *http.Request)
| 210 | |
| 211 | // HandleUnauthorized handles unauthorized access errors |
| 212 | func HandleUnauthorized(w http.ResponseWriter, r *http.Request) { |
| 213 | apiErr := util.NewApiError(http.StatusUnauthorized, "Unauthorized access", "unauthorized"). |
| 214 | WithCode("11010") |
| 215 | WriteJsonResp(w, apiErr, nil, apiErr.HttpStatusCode) |
| 216 | } |
| 217 | |
| 218 | // HandleForbidden handles forbidden access errors |
| 219 | func HandleForbidden(w http.ResponseWriter, r *http.Request, resource string) { |
no test coverage detected
searching dependent graphs…