mirror of
https://gitlab.manjaro.org/applications/manjaro-architect
synced 2024-11-08 01:10:26 +00:00
return function
This commit is contained in:
parent
4f4ca6a3dd
commit
7f3696574f
10
lib/util.sh
10
lib/util.sh
@ -145,10 +145,14 @@ id_system() {
|
||||
|
||||
# If there is an error, display it and go back to main menu. In any case, write to logfile.
|
||||
# param 2 : error code is optional
|
||||
# param 3 : return menu function , optional, default: main_menu_online
|
||||
check_for_error() {
|
||||
local _msg="$1"
|
||||
local _err="${2:-0}"
|
||||
local _function_menu="${3:-main_menu_online}"
|
||||
local _canceldlg=1
|
||||
local _fpath="${FUNCNAME[*]:1}()"
|
||||
_fpath=" --${_fpath// /()<-}"
|
||||
((${_err}!=0)) && _msg="[${_msg}][${_err}]"
|
||||
[[ -f "${ERR}" ]] && {
|
||||
_msg="${_msg} $(head -n1 ${ERR})"
|
||||
@ -157,11 +161,11 @@ check_for_error() {
|
||||
}
|
||||
if ((${_err}!=0)) && ((${_canceldlg}==0)); then
|
||||
# and function varsdump ? _msg="$_msg \n $(declare -p | grep -v " _")"
|
||||
echo -e "$(date +%D\ %T) ERROR ${_msg}" >> "${LOGFILE}"
|
||||
echo -e "$(date +%D\ %T) ERROR ${_msg} ${_fpath}" >> "${LOGFILE}"
|
||||
DIALOG " $_ErrTitle " --msgbox "\n${_msg}\n" 0 0
|
||||
main_menu_online
|
||||
($_main_menu_online)
|
||||
else
|
||||
echo -e "$(date +%D\ %T) ${_msg}" >> "${LOGFILE}"
|
||||
echo -e "$(date +%D\ %T) ${_msg} ${_fpath}]" >> "${LOGFILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user