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
|
|
@ -29,10 +29,10 @@ func TestRequest(t *testing.T) {
|
|||
t.Fatalf("Request bad route: %d != 404", resp.StatusCode)
|
||||
}
|
||||
|
||||
// Test that apiError returns an error when trying to parse non-JSON response
|
||||
// Test that apiError returns an error response
|
||||
_, err = apiError(resp)
|
||||
if err == nil {
|
||||
t.Fatalf("apiError of a 404 response did not return an error: %#v", resp)
|
||||
if err != nil {
|
||||
t.Fatalf("apiError could not parse the response: %s", err)
|
||||
}
|
||||
|
||||
// Make a request with a bad offset to trigger a JSON response with Status set to 400
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue