From 1c650d475145c3db4e370576d89eb77abe6e5e52 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 12 Jan 2025 20:47:20 -0500 Subject: [PATCH] Avoid hard closing/crashing interative clients on SSH dialing failures --- sync/client.go | 2 +- wiki/developers.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sync/client.go b/sync/client.go index 8a824ef..42990b5 100644 --- a/sync/client.go +++ b/sync/client.go @@ -100,7 +100,7 @@ func GetSSHClient(manualSync bool) (*ssh.Client, string, bool) { sshClient, err := ssh.Dial("tcp", ip+":"+port, sshConfig) if err != nil { fmt.Println(core.AnsiError+"Sync failed - Unable to connect to remote server:", err.Error()+core.AnsiReset) - os.Exit(core.ErrorServerConnection) + core.Exit(core.ErrorServerConnection) // do not close/crash interactive clients } return sshClient, entryRoot, isWindows diff --git a/wiki/developers.md b/wiki/developers.md index 55575ed..32f6874 100644 --- a/wiki/developers.md +++ b/wiki/developers.md @@ -11,7 +11,7 @@ If any functionality in these two packages proves to be difficult to implement i Custom build tags can (and sometimes must) be used to achieve desired results. These are as follows: -- `interactive`: If making an interactive interface (GUI/TUI/interactive CLI), you probably need to use this build tag. Without it, your entire program will exit after any given operation is completed. This behavior is only desired for non-interactive CLI implementations, such as MUTN. Currently, most errors will result in the program exiting **even with this build tag**. Specific types of errors (such as config parsing errors) have been made exempt from this behavior. +- `interactive`: If making an interactive interface (GUI/TUI/interactive CLI), you probably need to use this build tag. Without it, your entire program will exit after any given operation is completed. This behavior is only desired for non-interactive CLI implementations, such as MUTN. Currently, most errors will result in the program exiting **even with this build tag**. Specific types of errors (such as config parsing/SSH dialing errors) have been made exempt from this behavior. - `wsl`: Allows creating a Linux binary that can interact with the Windows clipboard (for WSL) - `termux`: Allows creating an Android binary that can interact with the Termux clipboard (for Android)