Handling unhandled errors in the InfoCannedPolicy method. (#10575)

master
飞雪无情 4 years ago committed by GitHub
parent 511424a287
commit 27d9bd04e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      cmd/admin-handlers-users.go

@ -722,7 +722,10 @@ func (a adminAPIHandlers) InfoCannedPolicy(w http.ResponseWriter, r *http.Reques
return return
} }
json.NewEncoder(w).Encode(policy) if err = json.NewEncoder(w).Encode(policy); err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
return
}
w.(http.Flusher).Flush() w.(http.Flusher).Flush()
} }

Loading…
Cancel
Save