func sendErrResponse(w http.ResponseWriter, httpStatusCode int, appErr error) {
	w.WriteHeader(httpStatusCode)

	enc := json.NewEncoder(w)
	err := enc.Encode(map[string]string{"err": appErr.Error()})
	if err != nil {
		log.Error().Err(err).Msgf("could not encode json response: %v", err)
	}
}
// sendErrResponse converts raw objects and parameters to a json response specifically for erorrs
// and passes it to a provided writer. The creation of a separate function for just errors,
// is due to how they are handled differently from other payload types.
sendErrResponse converts raw objects and parameters to a json response specifically for erorrs
and passes it to a provided writer. The creation of a separate function for just errors,
is due to how they are handled differently from other payload types.
// sendErrResponse converts raw objects and parameters to a json response specifically for erorrs // and passes it to a provided writer . The creation of a separate function for just errors // is due to how they are handled differently from other payload types .
func sendErrResponse(w http.ResponseWriter, httpStatusCode int, appErr error) {
	w.WriteHeader(httpStatusCode)
	enc := json.NewEncoder(w)
	err := enc.Encode(map[string]string{"err": appErr.Error()})
	if err != nil {
		log.Error().Err(err).Msgf("could not encode json response: %v", err)
	}
}
func sendErrResponse ( w http . ResponseWriter , httpStatusCode int , appErr error ) { w . WriteHeader ( httpStatusCode ) enc := json . NewEncoder ( w ) err := enc . Encode ( map [ string ] string { " " : appErr . Error ( ) } ) if err != nil { log . Error ( ) . Err ( err ) . Msgf ( " " , err ) } }
sendErrResponse converts raw objects and parameters to a json response specifically for erorrs
and passes it to a provided writer.
sendErrResponse converts raw objects and parameters to a json response specifically for erorrs and passes it to a provided writer .