(w http.ResponseWriter, status int, message string)
| 28 | } |
| 29 | |
| 30 | func jsonError(w http.ResponseWriter, status int, message string) { |
| 31 | w.Header().Set("Content-Type", "application/json") |
| 32 | w.WriteHeader(status) |
| 33 | _ = json.NewEncoder(w).Encode(map[string]string{"error": message}) |
| 34 | } |
| 35 | |
| 36 | // jsonCodedError writes a JSON error with both a machine-readable code and |
| 37 | // a human-readable message. |
no test coverage detected