(w http.ResponseWriter, status int, code, message string)
| 2155 | } |
| 2156 | |
| 2157 | func writeError(w http.ResponseWriter, status int, code, message string) { |
| 2158 | writeJSON(w, status, map[string]interface{}{ |
| 2159 | "error": map[string]string{ |
| 2160 | "code": code, |
| 2161 | "message": message, |
| 2162 | }, |
| 2163 | }) |
| 2164 | } |
| 2165 | |
| 2166 | // writeInternalError logs the real error server-side and sends a generic |
| 2167 | // message to the client. This prevents leaking SQL errors, file paths, |
no test coverage detected