// displayError will create an error response
displayError will create an error response
// displayError will create an error response
func displayError(rw http.ResponseWriter, error string) {
	rw.WriteHeader(http.StatusBadRequest)
	rw.Header().Set("Content-type", "application/json")
	body, err := json.Marshal(map[string]string{"error": error})
	if err != nil {
		panic("Cannot generate the JSON.")
	}
	_, err = rw.Write(body)
	if err != nil {
		panic("Cannot display the error.")
	}
}
func displayError ( rw http . ResponseWriter , error string ) { rw . WriteHeader ( http . StatusBadRequest ) rw . Header ( ) . Set ( " " , " " ) body , err := json . Marshal ( map [ string ] string { " " : error } ) if err != nil { panic ( " " ) } _ , err = rw . Write ( body ) if err != nil { panic ( " " ) } }
displayError will create an error response
displayError will create an error response