From f8f95554d54761369417c07acc64b1588b624ccf Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 12 Apr 2012 22:18:38 -0700 Subject: [PATCH] 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 --- cmd/camput/files.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/camput/files.go b/cmd/camput/files.go index 3d98e6bf7..ca29f8c45 100644 --- a/cmd/camput/files.go +++ b/cmd/camput/files.go @@ -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)