Skip to content

Commit

Permalink
mc heal and mc mirror should respond with proper exit code
Browse files Browse the repository at this point in the history
respond with os.exit(0) incase of errors

Fixes #2534 #2474
  • Loading branch information
Praveenrajmani committed Sep 20, 2018
1 parent 044a95b commit 3c0f142
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/admin-heal.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ func mainAdminHeal(ctx *cli.Context) error {
"Unable to display follow heal status.",
)

return nil
return herr
}
6 changes: 4 additions & 2 deletions cmd/typed-errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c0f142

Please sign in to comment.