diff --git a/cmd/admin-handlers-users.go b/cmd/admin-handlers-users.go index 3aff70741..0f2f29bca 100644 --- a/cmd/admin-handlers-users.go +++ b/cmd/admin-handlers-users.go @@ -722,7 +722,10 @@ func (a adminAPIHandlers) InfoCannedPolicy(w http.ResponseWriter, r *http.Reques 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() }