-
Notifications
You must be signed in to change notification settings - Fork 245
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
SSH Config Panic Handler #1571
SSH Config Panic Handler #1571
Conversation
Match statements in include files still seem to cause panics with the ssh_config library.
WalkthroughThe pull request introduces modifications to the A key modification is the integration of a panic handler from the The changes also refine the error handling approach in the These modifications aim to enhance the reliability and error management capabilities of the SSH client implementation, ensuring more graceful handling of potential configuration and connection-related challenges. Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/remote/sshclient.go (1)
754-760
: Consider preserving any existing errors alongside the panic error.
Currently, if the function encounters both an in-function error (assigned to outErr) and a panic, the panic error overwrites the existing error. This may hide helpful context for debugging. Consider wrapping or appending the panic error to the existing error rather than replacing it.Below is a possible approach to preserving both errors:
defer func() { err := panichandler.PanicHandler("sshclient:find-ssh-config-keywords") if err != nil { - outErr = err + if outErr != nil { + outErr = fmt.Errorf("original error: %v | panic error: %w", outErr, err) + } else { + outErr = err + } } }()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pkg/remote/sshclient.go
(2 hunks)
🔇 Additional comments (1)
pkg/remote/sshclient.go (1)
26-26
: New import appears correct and aligns with the PR’s objectives.
The import "github.com/wavetermdev/waveterm/pkg/panichandler" is introduced here, presumably to capture and handle panics within the SSH config reading logic. This seems consistent with the PR objective.
Match statements in files that are included in an ssh config still seem to cause panics with the ssh_config library. This adds a panic handler to catch them, and prevent the app from crashing. It does not resolve the underlying issue which will need to be done later.