Merge pull request #6881 from nikhiljindal/errHandle

Registering a serviceErrorHandler with go-restful to always return JSON responses
This commit is contained in:
Brian Grant
2015-04-16 16:44:17 -07:00
4 changed files with 27 additions and 9 deletions

View File

@@ -792,7 +792,7 @@ func (r *Request) transformUnstructuredResponseError(resp *http.Response, req *h
message = strings.TrimSpace(string(body))
}
retryAfter, _ := retryAfterSeconds(resp)
return errors.NewGenericServerResponse(resp.StatusCode, req.Method, r.resource, r.resourceName, message, retryAfter)
return errors.NewGenericServerResponse(resp.StatusCode, req.Method, r.resource, r.resourceName, message, retryAfter, true)
}
// isTextResponse returns true if the response appears to be a textual media type.