Browse Source

filer: return not found 404 status if not found

fix https://github.com/chrislusf/seaweedfs/issues/1160
pull/1167/head
Chris Lu 5 years ago
parent
commit
36ddca9d1f
  1. 6
      weed/server/filer_server_handlers_write.go

6
weed/server/filer_server_handlers_write.go

@ -290,7 +290,11 @@ func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
err := fs.filer.DeleteEntryMetaAndData(context.Background(), filer2.FullPath(r.URL.Path), isRecursive, ignoreRecursiveError, !skipChunkDeletion)
if err != nil {
glog.V(1).Infoln("deleting", r.URL.Path, ":", err.Error())
writeJsonError(w, r, http.StatusInternalServerError, err)
httpStatus := http.StatusInternalServerError
if err == filer2.ErrNotFound {
httpStatus = http.StatusNotFound
}
writeJsonError(w, r, httpStatus, err)
return
}

Loading…
Cancel
Save