Skip to content

fix: improve errors - #1088

Open
otjdiepluong wants to merge 1 commit into
goreleaser:mainfrom
otjdiepluong:planb/agent-002/20260516174514
Open

otjdiepluong wants to merge 1 commit into
goreleaser:mainfrom
otjdiepluong:planb/agent-002/20260516174514

Conversation

@otjdiepluong

@otjdiepluong otjdiepluong commented May 16, 2026 •

Copy link
Copy Markdown

Summary:

  • Tighten error wrapping in the deb/rpm writer paths so callers can inspect the original cause.
  • Add focused coverage for the wrapped-error behavior.

Notes:

  • I kept this scoped to the relevant packaging path and tests.

@pull-request-size pull-request-size Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 16, 2026
Comment thread deb/deb_test.go
Comment on lines +1664 to +1679
type failAfterNWriter struct {
n int
err error
}

func (w *failAfterNWriter) Write(p []byte) (int, error) {
if w.n <= 0 {
return 0, w.err
}
if len(p) > w.n {
p = p[:w.n]
}
w.n -= len(p)
return len(p), nil
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't really need fail after n bytes on the tests I think?

could be just

type errWriter struct{ err error }

func (e *errWriter) Write([]byte) (int, error) { return 0, e.err }

@caarlos0 caarlos0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one comment, looks good otherwise

thanks 🙏🏻

@caarlos0 caarlos0 changed the title chore: improve nfpm maintenance path fix: improve nfpm maintenance path May 19, 2026
@caarlos0 caarlos0 changed the title fix: improve nfpm maintenance path fix: improve errors May 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants