From 454261962e70643345a5ed9e3067f28bc9af2d17 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Tue, 17 Nov 2015 23:30:08 -0800 Subject: [PATCH] detect invalid bucketname for mirror #1404 --- mirror-url.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mirror-url.go b/mirror-url.go index 30f4c0ab..43990a62 100644 --- a/mirror-url.go +++ b/mirror-url.go @@ -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)) + } } }