-
Notifications
You must be signed in to change notification settings - Fork 47
Use fmt.Errorf instead of errors.Wrap where error handling make sense #831
Conversation
aff3a40
to
210270f
Compare
Isn't @johananl changing those in the files related to platform package as part of his refactoring PR ? |
I'm not sure how is this related. The platform package refactoring PR is not even opened yet, but still it's focus would be different. |
@invidian should we add //TODOs in the same commit? |
I can't come up with any pro or con for committing it separately vs committing it together, maybe except that doing it together is a bit less work. So I'm not sure 😄 |
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 nit. Rest LGTM!
210270f
to
f3b9137
Compare
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.
LGTM +1
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.
Thanks. Added some comments.
f3b9137
to
65b6db1
Compare
Thanks for reviewing @johananl, I addressed all your comments, please have a look again. |
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.
Found two missing periods. LGTM otherwise.
This commit partially addresses issue #59, which encourages to use new error wrapping semantics available since Go 1.13, using %w formatting verb instead of 3rd party 'pkg/errors' package. This commit changes errors handling code from using errors.Wrap with fmt.Errorf where error handling should remain as is. For other uses of errors.Wrap, it adds a comment with TODO how code should be changed to either avoid or delegate error handling to someone else. This commit also changes error phrasing to the format we agreed in #59. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
Our codebase and vendor/ directory prefers 'marshaling' over 'marshalling', so this commit changes last remaining occurence of unmarshalling to be consistent with rest of the error messages. Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
65b6db1
to
8cfd6fe
Compare
This commit partially addresses issue #59, which encourages to use new
error wrapping semantics available since Go 1.13, using %w formating
verb instead of 3rd party 'pkg/errors' package.
This commit changes errors handling code from using errors.Wrap with
fmt.Errorf where error handling should remain as is. For other uses of
errors.Wrap, it adds a comment with TODO how code should be changed to
either avoid or delegate error handling to someone else.
Signed-off-by: Mateusz Gozdek mateusz@kinvolk.io