mirror of
https://github.com/rwinkhart/libmutton.git
synced 2026-08-30 22:06:32 -04:00
Avoid hard closing/crashing interative clients on SSH dialing failures
This commit is contained in:
+1
-1
@@ -100,7 +100,7 @@ func GetSSHClient(manualSync bool) (*ssh.Client, string, bool) {
|
|||||||
sshClient, err := ssh.Dial("tcp", ip+":"+port, sshConfig)
|
sshClient, err := ssh.Dial("tcp", ip+":"+port, sshConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(core.AnsiError+"Sync failed - Unable to connect to remote server:", err.Error()+core.AnsiReset)
|
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
|
return sshClient, entryRoot, isWindows
|
||||||
|
|||||||
+1
-1
@@ -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.
|
Custom build tags can (and sometimes must) be used to achieve desired results.
|
||||||
|
|
||||||
These are as follows:
|
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)
|
- `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)
|
- `termux`: Allows creating an Android binary that can interact with the Termux clipboard (for Android)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user