diff --git a/cmd/client-errors.go b/cmd/client-errors.go index 2a22f2a3..bc7b5f42 100644 --- a/cmd/client-errors.go +++ b/cmd/client-errors.go @@ -150,7 +150,7 @@ func (e EmptyPath) Error() string { type ObjectMissing struct{} func (e ObjectMissing) Error() string { - return "Object key is missing, object key cannot be empty" + return "Object does not exist" } // UnexpectedShortWrite - write wrote less bytes than expected. diff --git a/cmd/share-download-main.go b/cmd/share-download-main.go index e25b1fd8..c6f3105f 100644 --- a/cmd/share-download-main.go +++ b/cmd/share-download-main.go @@ -89,9 +89,15 @@ func checkShareDownloadSyntax(ctx *cli.Context) { fatalIf(errDummy().Trace(expiry.String()), "Expiry cannot be larger than 7 days.") } - for _, url := range ctx.Args() { - _, _, err := url2Stat(url) - fatalIf(err.Trace(url), "Unable to stat `"+url+"`.") + // Validate if object exists only if the `--recursive` option was NOT specified + isRecursive := ctx.Bool("recursive") + if !isRecursive { + for _, url := range ctx.Args() { + _, _, err := url2Stat(url) + if err != nil { + fatalIf(err.Trace(url), "Unable to stat `"+url+"`.") + } + } } }