Skip to content

cli: errors from RunE are silently swallowed (no stderr) #910

@zeevdr

Description

@zeevdr

Description

cmd/decree/main.go sets SilenceErrors: true and SilenceUsage: true on the root cobra command, but main() only calls os.Exit(1) on error without printing it. Any error returned from a command's RunE (e.g. an invalid --file schema passed to decree docgen --file) is swallowed entirely — the CLI exits 1 with no stdout/stderr output, making failures impossible to diagnose.

Acceptance criteria

  • main() prints the returned error (e.g. to stderr) before os.Exit(1)
  • Verify with a failing offline command (e.g. decree docgen --file <invalid-schema.yaml>) that the error message is now printed
  • Add a test covering this error-printing path (e.g. in cmd/decree/cli_test.go or helpers_test.go)
  • Run go tool cover -func to confirm new code is covered per repo coverage policy

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliCLI changespriority: P1Current milestone worksize: SQuick win — a few hours or less

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions