minor fixes to mc share download command (#2106)
improved error messages and issue with `--recursive` option. Fixes #2099
This commit is contained in:
committed by
Harshavardhana
parent
1bf5ac350f
commit
9eb967cabf
@@ -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.
|
||||
|
||||
@@ -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+"`.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user