Log useful information on 500's

* include error message in error (!!)
* add test verifying error message is correct for service ip allocation
This commit is contained in:
Daniel Smith
2016-08-30 16:56:56 -07:00
parent 1dfd6ab0c1
commit 1a23f5a79f
4 changed files with 66 additions and 2 deletions

View File

@@ -266,7 +266,13 @@ func InstallServiceErrorHandler(s runtime.NegotiatedSerializer, container *restf
}
func serviceErrorHandler(s runtime.NegotiatedSerializer, requestResolver *RequestInfoResolver, apiVersions []string, serviceErr restful.ServiceError, request *restful.Request, response *restful.Response) {
errorNegotiated(apierrors.NewGenericServerResponse(serviceErr.Code, "", api.Resource(""), "", "", 0, false), s, unversioned.GroupVersion{}, response.ResponseWriter, request.Request)
errorNegotiated(
apierrors.NewGenericServerResponse(serviceErr.Code, "", api.Resource(""), "", serviceErr.Message, 0, false),
s,
unversioned.GroupVersion{},
response.ResponseWriter,
request.Request,
)
}
// Adds a service to return the supported api versions at the legacy /api.