mirror of https://github.com/perkeep/perkeep.git
camput: fix panic on errors.
I think maybe I should just change handleResult to panic with its own error type and catch it above. Change-Id: Ib0622321e29e7926173c4957dc0e56f3b514e7d2
This commit is contained in:
parent
e4a17bc8ac
commit
f8f95554d5
|
@ -128,11 +128,15 @@ func (c *fileCmd) RunCommand(up *Uploader, args []string) error {
|
|||
|
||||
for _, filename := range args {
|
||||
lastPut, err = up.UploadFile(filename, c.rollSplits)
|
||||
handleResult("file", lastPut, err)
|
||||
if handleResult("file", lastPut, err) != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if permaNode != nil {
|
||||
put, err := up.UploadAndSignMap(schema.NewSetAttributeClaim(permaNode.BlobRef, "camliContent", lastPut.BlobRef.String()))
|
||||
handleResult("claim-permanode-content", put, err)
|
||||
if handleResult("claim-permanode-content", put, err) != nil {
|
||||
return err
|
||||
}
|
||||
if c.name != "" {
|
||||
put, err := up.UploadAndSignMap(schema.NewSetAttributeClaim(permaNode.BlobRef, "name", c.name))
|
||||
handleResult("claim-permanode-name", put, err)
|
||||
|
|
Loading…
Reference in New Issue