Browse Source

better error message if directory is not found

pull/2/head
Chris Lu 12 years ago
parent
commit
ddf4f27a56
  1. 16
      go/weed/upload.go

16
go/weed/upload.go

@ -125,13 +125,17 @@ func runUpload(cmd *Command, args []string) bool {
return false return false
} }
filepath.Walk(*uploadDir, func(path string, info os.FileInfo, err error) error { filepath.Walk(*uploadDir, func(path string, info os.FileInfo, err error) error {
if !info.IsDir() {
results, e := submit([]string{path})
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
if e != nil {
return e
if err == nil {
if !info.IsDir() {
results, e := submit([]string{path})
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
if e != nil {
return e
}
} }
} else {
fmt.Println(err)
} }
return err return err
}) })

Loading…
Cancel
Save