mc heal and mc mirror should respond with proper exit code (#2543)

respond with os.exit(0) incase of errors

Fixes #2534 #2474
This commit is contained in:
Praveen raj Mani
2018-09-20 15:23:40 -07:00
committed by kannappanr
parent c9f33698fc
commit b2d2e09105
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -131,5 +131,5 @@ func mainAdminHeal(ctx *cli.Context) error {
"Unable to display follow heal status.",
)
return nil
return herr
}
+4 -2
View File
@@ -96,11 +96,13 @@ var errInvalidTarget = func(URL string) *probe.Error {
return probe.NewError(invalidTargetErr(errors.New(msg))).Untrace()
}
type overwriteNotAllowedErr error
type overwriteNotAllowedErr struct {
error
}
var errOverWriteNotAllowed = func(URL string) *probe.Error {
msg := "Overwrite not allowed for `" + URL + "`. Use `--overwrite` to override this behavior."
return probe.NewError(overwriteNotAllowedErr(errors.New(msg)))
return probe.NewError(overwriteNotAllowedErr{errors.New(msg)})
}
type sourceIsDirErr error