Skip to content

Commit

Permalink
Stop deciding every response is an error
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDiscordian committed Mar 19, 2021
1 parent f04215e commit 81fc287
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ func AddDir(path string, nocopy bool) (string, error) {
}
repl, err := AddFile(file, dirName+"/"+file[len(path):], nocopy)
if err != nil || repl != "" {
if repl != "" {
err = errors.New(repl)
}
//if repl != "" { FIXME check if resp is really an error before deciding it is
// err = errors.New(repl)
//}
return "", err
}
}
Expand Down Expand Up @@ -394,9 +394,9 @@ func AddFile(from, to string, nocopy bool) (string, error) {
}
repl, err := doRequest(fmt.Sprintf(`files/cp?arg=%s&arg=%s`, "/ipfs/"+url.QueryEscape(hash.Hash), url.QueryEscape(BasePath+to)))
if err != nil || repl != "" {
if repl != "" {
err = errors.New(repl)
}
//if repl != "" { FIXME check if response is *actually* an error, before deciding it is.
// err = errors.New(repl)
//}
log.Println(err)
}
return hash.Hash, err
Expand Down

0 comments on commit 81fc287

Please sign in to comment.