aboutsummaryrefslogtreecommitdiff
path: root/weed-fs/src/cmd
diff options
context:
space:
mode:
authorchris.lu@gmail.com <chris.lu@gmail.com@282b0af5-e82d-9cf1-ede4-77906d7719d0>2011-12-28 20:31:13 +0000
committerchris.lu@gmail.com <chris.lu@gmail.com@282b0af5-e82d-9cf1-ede4-77906d7719d0>2011-12-28 20:31:13 +0000
commit2ccc098882c991e1722ae7aca08b1e0d0e048ef3 (patch)
treed8e513a3bbddac946e0b905a39959cf84a0366dc /weed-fs/src/cmd
parent60c17068a689552343d7382283f3a295fcf7764b (diff)
downloadseaweedfs-2ccc098882c991e1722ae7aca08b1e0d0e048ef3.tar.xz
seaweedfs-2ccc098882c991e1722ae7aca08b1e0d0e048ef3.zip
better error messages
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@31 282b0af5-e82d-9cf1-ede4-77906d7719d0
Diffstat (limited to 'weed-fs/src/cmd')
-rw-r--r--weed-fs/src/cmd/weedc.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed-fs/src/cmd/weedc.go b/weed-fs/src/cmd/weedc.go
index 6d40b9586..56cbf9e86 100644
--- a/weed-fs/src/cmd/weedc.go
+++ b/weed-fs/src/cmd/weedc.go
@@ -111,6 +111,10 @@ func writeJson(w http.ResponseWriter, r *http.Request, obj interface{}) {
func parseURLPath(path string) (vid, fid, ext string) {
sepIndex := strings.LastIndex(path, "/")
commaIndex := strings.LastIndex(path[sepIndex:], ",")
+ if commaIndex <= 0 {
+ log.Println("unknown file id", path[sepIndex+1:])
+ return
+ }
dotIndex := strings.LastIndex(path[sepIndex:], ".")
vid = path[sepIndex+1 : commaIndex]
fid = path[commaIndex+1:]
@@ -119,10 +123,6 @@ func parseURLPath(path string) (vid, fid, ext string) {
fid = path[commaIndex+1 : dotIndex]
ext = path[dotIndex+1:]
}
- if commaIndex <= 0 {
- log.Println("unknown file id", path[sepIndex+1:commaIndex])
- return
- }
return
}