-
Notifications
You must be signed in to change notification settings - Fork 2
fix and check all suppressed errors #138
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: maxeng-error-handling-3
Are you sure you want to change the base?
Conversation
Signed-off-by: Max Englander <[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 addresses the suppression of errors by replacing blank identifier patterns with proper error checking in the code.
- Replaces error suppression with explicit error handling in the TableCursorToSerializedCursor function.
- Implements error handling for checkConnectionStatus to log connection errors.
- Updates .golangci.yml to enable errcheck with check-blank set to true.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
cmd/internal/planetscale_connection.go | Adds error handling for converting TableCursor to a serialized cursor. |
cmd/airbyte-source/check.go | Implements error handling for checking the connection status. |
.golangci.yml | Updates linting configuration to check for blank error assignments. |
@@ -49,7 +49,10 @@ func CheckCommand(ch *Helper) *cobra.Command { | |||
} | |||
}() | |||
|
|||
cs, _ := checkConnectionStatus(ch.Database, psc) | |||
cs, err := checkConnectionStatus(ch.Database, psc) | |||
if err != nil { |
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.
After logging the error in the 'if' block, consider altering the control flow to avoid using 'cs' when an error occurs. For example, returning from the function or using an alternative handling mechanism would prevent potential issues from processing an invalid connection status.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
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 tried doing that originally, but it broke tests. Let's add a // TODO
here to fix that.
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.
yes
Prev: #137
Fix all cases of
..., _ := errorReturningThing()
.