-
Notifications
You must be signed in to change notification settings - Fork 139
fix(catalog,manifest): handle some ignored errors #670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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]>
eb82257 to
9ddcab7
Compare
zeroshade
left a comment
There was a problem hiding this 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
| dec := json.NewDecoder(rsp.Body) | ||
| dec.Decode(&struct { | ||
| Error *errorResponse `json:"error"` | ||
| }{Error: &e}) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| err = db.RunInTx(ctx, &sql.TxOptions{ReadOnly: true}, func(ctx context.Context, tx bun.Tx) error { | ||
| result, err = fn(ctx, tx) | ||
|
|
||
| return err | ||
| }) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
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.