middleware/query/response.go

11 lines
234 B
Go
Raw Normal View History

2024-01-07 03:00:59 +00:00
package query
import (
"net/http"
)
func RespondWithBadRequest(w http.ResponseWriter, _ *http.Request, err error) {
text := http.StatusText(http.StatusBadRequest) + ": " + err.Error()
http.Error(w, text, http.StatusBadRequest)
}