-
Notifications
You must be signed in to change notification settings - Fork 457
fixing some of the missed/ignored errors #446
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
Conversation
- handling some missed errors Signed-off-by: egorikas <[email protected]>
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.
Pull Request Overview
This PR improves error handling by addressing ignored/missed errors throughout the codebase. The primary focus is to explicitly handle errors that were previously being silently ignored, which could lead to unexpected application behavior.
- Introduces a new
closers.Close
utility function that logs errors during resource cleanup - Replaces direct
defer closer.Close()
calls with proper error handling - Adds explicit error checking for write operations and other critical functions
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
utils/closers/closer.go | New utility for logging errors during resource cleanup |
utils/closers/closer_test.go | Comprehensive tests for the closer utility |
mocks/io/mock_closer.go | Mock implementation for testing closer functionality |
Multiple client/server files | Replaced bare defer statements with proper error handling using closers.Close |
Test files | Added error checking for write operations and resource cleanup |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Fix spelling error: 'utulity' should be 'utility'. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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 @egorikas
Some queries but overall looks good.
Thanks for the review. I've made a few quick fixes here and there. |
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 @egorikas for handing this
LGTM
Why
Ignoring of errors is a bad coding practice that can lead to the non-expected results. Silent errors may cause serious disturbances to the application working.
What
Fixing part of the ignored/missed errors.
How
closers.Close
function to log errors happening during closing of different objects.