diff --git a/cmd/drone-ansible/main.go b/cmd/drone-ansible/main.go index 3155479..75b861b 100644 --- a/cmd/drone-ansible/main.go +++ b/cmd/drone-ansible/main.go @@ -53,11 +53,21 @@ func run(settings *plugin.Settings) cli.ActionFunc { ) if err := plugin.Validate(); err != nil { - return fmt.Errorf("validation failed: %w", err) + //nolint:errorlint + if e, ok := err.(errors.ExitCoder); ok { + return e + } + + return errors.ExitMessagef("validation failed: %w", err) } if err := plugin.Execute(); err != nil { - return fmt.Errorf("execution failed: %w", err) + //nolint:errorlint + if e, ok := err.(errors.ExitCoder); ok { + return e + } + + return errors.ExitMessagef("execution failed: %w", err) } return nil