Skip to content

Standardize on error wrapping in CLI #3040

@dmjb

Description

@dmjb

Description:

Convert all fmt.Errorf(..., %v, err) to fmt.Errorf(..., %w, err) to enable proper error chain wrapping. This improves error debugging throughout the codebase. There are multiple parts of the codebase which have this issue.

Background:

  • Codebase uses a mix of %w and %v.
  • Using %w enables errors.Is() and errors.As() checks

Tasks:

  • Replace all instances of %v with %w in the CLI when handling error types.

Pattern:

// BEFORE:
return fmt.Errorf("failed to create manager: %v", err)

// AFTER:
return fmt.Errorf("failed to create manager: %w", err)

Acceptance Criteria:

  • All instances of %v converted to %w when handling error types
  • All tests pass

Metadata

Metadata

Assignees

Labels

cliChanges that impact CLI functionalitygoPull requests that update go codegood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions