Do not show successful msg in mb command when the latter actually fails (#1761)

This commit is contained in:
Anis Elleuch
2016-07-10 17:04:21 -07:00
committed by Harshavardhana
parent 489d1629fb
commit 16ae081c4c
+8 -2
View File
@@ -117,11 +117,17 @@ func mainMakeBucket(ctx *cli.Context) {
targetURL := ctx.Args().Get(i)
// Instantiate client for URL.
clnt, err := newClient(targetURL)
errorIf(err.Trace(targetURL), "Invalid target ‘"+targetURL+"’.")
if err != nil {
errorIf(err.Trace(targetURL), "Invalid target ‘"+targetURL+"’.")
continue
}
// Make bucket.
err = clnt.MakeBucket(region)
errorIf(err.Trace(targetURL), "Unable to make bucket ‘"+targetURL+"’.")
if err != nil {
errorIf(err.Trace(targetURL), "Unable to make bucket ‘"+targetURL+"’.")
continue
}
// Successfully created a bucket.
printMsg(makeBucketMessage{Status: "success", Bucket: targetURL})