From 5156e06ff66439f661b20a398586ef607005d7bf Mon Sep 17 00:00:00 2001 From: fosslinux Date: Wed, 21 Nov 2018 23:31:40 -0800 Subject: [PATCH] Better error handling --- setup_gui.sh | 4 ++-- sshfs_gui.sh | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/setup_gui.sh b/setup_gui.sh index e23f96a..c45684c 100755 --- a/setup_gui.sh +++ b/setup_gui.sh @@ -87,8 +87,8 @@ get_info() { --button="Cancel":1 \ --button="Continue":0 \ "$server_address" "$server_name" "$login" "$ssh_port" "$ssh_dir" "$priv_key_path") - [ $? -ne 0 ] && exit # Shellcheck will yell at me for this, perhaps find a better way? - + [ $? -eq 1 ] && exit 1 + server_address=$(get_field 1 "$info") server_name=$(get_field 2 "$info") login=$(get_field 3 "$info") diff --git a/sshfs_gui.sh b/sshfs_gui.sh index c8c54ef..a617fe0 100755 --- a/sshfs_gui.sh +++ b/sshfs_gui.sh @@ -98,7 +98,7 @@ get_info() { then if ! "$setup_script_path" then - error_box "Could not run $setup_script_path" + error_box "$setup_script_path did not finish successfully" get_info fi fi @@ -129,7 +129,6 @@ get_info() { } configure_mount() { - info_box "Attempting to link directories..." & info_pid=$(( $! + 2 )) # yikes, is this safe? @@ -155,7 +154,6 @@ configure_mount() { kill $info_pid error_box "Failed to link $sshfs_local_path to $sshfs_remote_path on $server_name\\n$error_msg" fi - } get_info