Rename WriteErrorResponse() to simply ErrorJSON() and reorder arguments
This way we better mimic net/http.Error() https://pkg.go.dev/net/http?tab=doc#Error
This commit is contained in:
@@ -38,7 +38,7 @@ func configRouter(rs []routeSpec) (r *mux.Router) {
|
||||
r.HandleFunc(
|
||||
"/handlers/{handlerID}/{resource:.*}",
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
srverrors.WriteErrorResponse(http.StatusBadRequest, "Invalid Resource Path", w)
|
||||
srverrors.ErrorJSON(w, "Invalid Resource Path", http.StatusBadRequest)
|
||||
})
|
||||
return r
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user