manirajv06 commented on a change in pull request #231:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/231#discussion_r564422110
##########
File path: pkg/webservice/webservice.go
##########
@@ -58,14 +59,40 @@ func newRouter() *mux.Router {
func loggingHandler(inner http.Handler, name string) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now()
-
- inner.ServeHTTP(w, r)
-
+ rw := &YResponseWriter{ResponseWriter: w, statusCode: -1}
+ inner.ServeHTTP(rw, r)
+ var body = string(rw.body)
+ if rw.statusCode != 200 && rw.statusCode != -1 {
+ errorInfo := dao.NewYAPIError(nil, rw.statusCode, body)
Review comment:
Missed this file. Added now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]