Skip to content

Conversation

@ferhatelmas
Copy link
Contributor

Also enable errcheck linter for future.
Ignore table printer errors for cli which are
self observable and mostly fine. Ignoring it
in tests. There are many violations, could be
enabled separately if needed.

Also enable errcheck linter for future.
Ignore table printer errors for cli which are
self observable and mostly fine. Ignoring it
in tests. There are many violations, could be
enabled separately if needed.

Signed-off-by: ferhat elmas <[email protected]>
@ferhatelmas ferhatelmas changed the title (catalog,manifest): handle some ignored errors fix(catalog,manifest): handle some ignored errors Jan 9, 2026
Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

just a couple questions, but otherwise looks good

Comment on lines -360 to -363
dec := json.NewDecoder(rsp.Body)
dec.Decode(&struct {
Error *errorResponse `json:"error"`
}{Error: &e})
Copy link
Member

Choose a reason for hiding this comment

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

was this erroring or causing an issue somewhere? I assumed that if the body was empty then this would essentially be a no-op and nothing would happen.

Copy link
Contributor Author

@ferhatelmas ferhatelmas Jan 9, 2026

Choose a reason for hiding this comment

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

I was reviewing errors in the context of #667 and thought enabling errcheck would be better. This is one of the reported failures so trying to address

if the body was empty then this would essentially be a no-op and nothing would happen

that's correct but if there is a body and it fails to decode, it would be ignored, now it's more explicit

Comment on lines 157 to 161
err = db.RunInTx(ctx, &sql.TxOptions{ReadOnly: true}, func(ctx context.Context, tx bun.Tx) error {
result, err = fn(ctx, tx)

return err
})
Copy link
Member

Choose a reason for hiding this comment

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

would this err = conflict with the fact that we set err inside of the anonymous function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it won't because it will be set at last with correct error (i.e. commit)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants