Browse Source

s3tables: return 404 in handleDeleteNamespace if namespace not found

pull/8147/head
Chris Lu 3 days ago
parent
commit
5eed1874a9
  1. 6
      weed/s3api/s3tables/handler_namespace.go

6
weed/s3api/s3tables/handler_namespace.go

@ -383,10 +383,12 @@ func (h *S3TablesHandler) handleDeleteNamespace(w http.ResponseWriter, r *http.R
})
if err != nil {
if !errors.Is(err, filer_pb.ErrNotFound) {
if errors.Is(err, filer_pb.ErrNotFound) {
h.writeError(w, http.StatusNotFound, ErrCodeNoSuchNamespace, fmt.Sprintf("namespace %s not found", flattenNamespace(req.Namespace)))
} else {
h.writeError(w, http.StatusInternalServerError, ErrCodeInternalError, fmt.Sprintf("failed to list namespace entries: %v", err))
return err
}
return err
}
if hasChildren {

Loading…
Cancel
Save