diff --git a/cmd/fscrypt/errors.go b/cmd/fscrypt/errors.go index 10d744a4..65e76442 100644 --- a/cmd/fscrypt/errors.go +++ b/cmd/fscrypt/errors.go @@ -287,6 +287,10 @@ func getErrorSuggestions(err error) string { // returned error prepends an error tag and the name of the relevant command, // and it will make fscrypt return a non-zero exit value. func newExitError(c *cli.Context, err error) error { + if err == nil { + return nil + } + // Prepend the error tag and full name, and append suggestions (if any) prefix := "[ERROR] " + getFullName(c) + ": " message := prefix + wrapText(err.Error(), utf8.RuneCountInString(prefix))