(w http.ResponseWriter, status int, code, message string)
| 1808 | } |
| 1809 | |
| 1810 | func writeError(w http.ResponseWriter, status int, code, message string) { |
| 1811 | writeJSON(w, status, map[string]interface{}{ |
| 1812 | "error": map[string]string{ |
| 1813 | "code": code, |
| 1814 | "message": message, |
| 1815 | }, |
| 1816 | }) |
| 1817 | } |
| 1818 | |
| 1819 | // writeInternalError logs the real error server-side and sends a generic |
| 1820 | // message to the client. This prevents leaking SQL errors, file paths, |
no test coverage detected