(w http.ResponseWriter, status int, code, message string)
| 1942 | } |
| 1943 | |
| 1944 | func writeError(w http.ResponseWriter, status int, code, message string) { |
| 1945 | writeJSON(w, status, map[string]interface{}{ |
| 1946 | "error": map[string]string{ |
| 1947 | "code": code, |
| 1948 | "message": message, |
| 1949 | }, |
| 1950 | }) |
| 1951 | } |
| 1952 | |
| 1953 | // writeInternalError logs the real error server-side and sends a generic |
| 1954 | // message to the client. This prevents leaking SQL errors, file paths, |
no test coverage detected