aboutsummaryrefslogtreecommitdiff
path: root/weed-fs/src/cmd
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2012-09-26 20:30:05 -0700
committerChris Lu <chris.lu@gmail.com>2012-09-26 20:30:05 -0700
commit33d5778a464592190fdee7cadf3e18bf2a1ec40b (patch)
treed8b58e2ce43108e35de7ff2887511cc765e44ce7 /weed-fs/src/cmd
parent46d13f6b5eb3faa6610857744ce98bb656f04a6c (diff)
downloadseaweedfs-33d5778a464592190fdee7cadf3e18bf2a1ec40b.tar.xz
seaweedfs-33d5778a464592190fdee7cadf3e18bf2a1ec40b.zip
cleaner error message
Diffstat (limited to 'weed-fs/src/cmd')
-rw-r--r--weed-fs/src/cmd/weed/volume.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/weed-fs/src/cmd/weed/volume.go b/weed-fs/src/cmd/weed/volume.go
index 55fbe1f03..2b75c2f75 100644
--- a/weed-fs/src/cmd/weed/volume.go
+++ b/weed-fs/src/cmd/weed/volume.go
@@ -99,7 +99,9 @@ func GetHandler(w http.ResponseWriter, r *http.Request) {
log.Println("read bytes", count, "error", e)
}
if e != nil || count <= 0 {
- log.Println("read error:", e)
+ if *IsDebug {
+ log.Println("read error:", e, r.URL.Path)
+ }
w.WriteHeader(http.StatusNotFound)
return
}
@@ -142,7 +144,6 @@ func PostHandler(w http.ResponseWriter, r *http.Request) {
}) {
ret = 0
errorStatus = "Failed to write to replicas for volume " + volumeId.String()
- w.WriteHeader(http.StatusInternalServerError)
}
}
} else {
@@ -152,6 +153,10 @@ func PostHandler(w http.ResponseWriter, r *http.Request) {
if errorStatus == "" {
w.WriteHeader(http.StatusCreated)
} else {
+ store.Delete(volumeId, needle)
+ distributedOperation(volumeId, func(location operation.Location) bool {
+ return nil == operation.Delete("http://"+location.Url+r.URL.Path+"?type=standard")
+ })
w.WriteHeader(http.StatusInternalServerError)
m["error"] = errorStatus
}