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:
Brad Fitzpatrick 2012-04-12 22:18:38 -07:00
parent e4a17bc8ac
commit f8f95554d5
1 changed files with 6 additions and 2 deletions

View File

@ -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)