detect invalid bucketname for mirror #1404

This commit is contained in:
Krishna Srinivas
2015-11-17 23:47:14 -08:00
parent 2a3485b4be
commit 454261962e
+5
View File
@@ -90,6 +90,11 @@ func checkMirrorSyntax(ctx *cli.Context) {
fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("Target ‘%s’ does not contain bucket name.", tgtURL))
}
}
_, _, err = url2Stat(tgtURL)
// we die on any error other than client.PathNotFound - destination directory need not exist.
if _, ok := err.ToGoError().(client.PathNotFound); !ok {
fatalIf(err.Trace(), fmt.Sprintf("Unable to stat %s", tgtURL))
}
}
}