weldr: Return a JSON API error response for all unknown requests
This matches the lorax-composer behavior.
This commit is contained in:
parent
e3934108f7
commit
fc205786fc
3 changed files with 10 additions and 5 deletions
|
|
@ -167,7 +167,12 @@ func methodNotAllowedHandler(writer http.ResponseWriter, request *http.Request)
|
|||
}
|
||||
|
||||
func notFoundHandler(writer http.ResponseWriter, request *http.Request) {
|
||||
writer.WriteHeader(http.StatusNotFound)
|
||||
errors := responseError{
|
||||
Code: http.StatusNotFound,
|
||||
ID: "HTTPError",
|
||||
Msg: "Not Found",
|
||||
}
|
||||
statusResponseError(writer, http.StatusNotFound, errors)
|
||||
}
|
||||
|
||||
func notImplementedHandler(writer http.ResponseWriter, httpRequest *http.Request, _ httprouter.Params) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue