func sendErrorResponse(w http.ResponseWriter, r *http.Request, statusCode int, e error) {
	log.Print(e)
	jsonResp, err := createJSON(ErrorResp{Error: e.Error()})
	if err != nil {
		log.Fatal(err)
	}
	sendResponse(w, r, statusCode, jsonResp)
}
// sendErrorResponse same as sendResponse but creates and logs the error message to send.
sendErrorResponse same as sendResponse but creates and logs the error message to send.
// sendErrorResponse same as sendResponse but creates and logs the error message to send .
func sendErrorResponse(w http.ResponseWriter, r *http.Request, statusCode int, e error) {
	log.Print(e)
	jsonResp, err := createJSON(ErrorResp{Error: e.Error()})
	if err != nil {
		log.Fatal(err)
	}
	sendResponse(w, r, statusCode, jsonResp)
}
func sendErrorResponse ( w http . ResponseWriter , r * http . Request , statusCode int , e error ) { log . Print ( e ) jsonResp , err := createJSON ( ErrorResp { Error : e . Error ( ) } ) if err != nil { log . Fatal ( err ) } sendResponse ( w , r , statusCode , jsonResp ) }
sendErrorResponse same as sendResponse but creates and logs the error message to send.
sendErrorResponse same as sendResponse but creates and logs the error message to send .