The main server, and probably only repository in this org.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
381 B

package respond
import "net/http"
// Error responds with a standardized error object.
func Error(w http.ResponseWriter, code int, kind string, message string) {
type errorContent struct {
Code int `json:"code"`
Kind string `json:"kind"`
Message string `json:"message"`
}
JSON(w, code, &errorContent{
Code: code,
Kind: kind,
Message: message,
})
}