You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/05/02 04:31:22 UTC

[GitHub] [incubator-yunikorn-core] yangwwei commented on a change in pull request #268: YUNIKORN-645. Fixed status code issues, error handling issues etc

yangwwei commented on a change in pull request #268:
URL: https://github.com/apache/incubator-yunikorn-core/pull/268#discussion_r624614038



##########
File path: pkg/webservice/handlers.go
##########
@@ -211,6 +211,14 @@ func writeHeaders(w http.ResponseWriter) {
 	w.Header().Set("Access-Control-Allow-Headers", "X-Requested-With,Content-Type,Accept,Origin")
 }
 
+func buildJSONErrorResponse(w http.ResponseWriter, detail string, code int) {
+	w.WriteHeader(code)
+	errorInfo := dao.NewYAPIError(nil, code, detail)
+	if jsonErr := json.NewEncoder(w).Encode(errorInfo); jsonErr != nil {

Review comment:
       Oh, misread that part. Thanks for the explaination.
   




-- 
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:
users@infra.apache.org