Better error handling

This commit is contained in:
fosslinux 2018-11-21 23:31:40 -08:00 committed by Samuel Tyler
parent 1bfd0ce145
commit 5156e06ff6
2 changed files with 3 additions and 5 deletions

View File

@ -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")

View File

@ -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