command error
This commit is contained in:
+1
-6
@@ -162,7 +162,6 @@ function on_exit {
|
||||
fi
|
||||
else
|
||||
failure_payload="${last_error}"
|
||||
miaou_debug "UNDEFINED last error=${last_error}"
|
||||
regex="╟─⟶"
|
||||
if [[ "$last_error" =~ $regex ]]; then
|
||||
last_trim=false # keep the last error for next stacktrace
|
||||
@@ -174,11 +173,7 @@ function on_exit {
|
||||
stack_functions[0]="${stack_functions[0]} (hint: prefer source than subshell)"
|
||||
[[ "${code}" == 128 ]] && failure_type='SUBSHELL_SOURCE_NOT_FOUND'
|
||||
else
|
||||
failure_type='UNDEFINED'
|
||||
regex='^subshell term:'
|
||||
if [[ "$last_error" =~ $regex ]]; then
|
||||
failure_type='SUBSHELL_TERM2'
|
||||
fi
|
||||
failure_type='COMMAND_ERROR'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ fail_type exit EXIT
|
||||
fail_type source_not_found SOURCE_NOT_FOUND
|
||||
fail_type file_not_found FILE_NOT_FOUND
|
||||
fail_type subshell_error COMMAND_NOT_FOUND '(hint: prefer source than subshell)'
|
||||
fail_type command_error COMMAND_ERROR
|
||||
|
||||
failed=$((TEST_COUNT - SUCCESS_COUNT))
|
||||
|
||||
|
||||
@@ -11,11 +11,12 @@ function blabla {
|
||||
|
||||
function suite {
|
||||
command_not_found
|
||||
echo $nope
|
||||
grep nope nope
|
||||
exit
|
||||
exit 10 # youpi
|
||||
echo $nope
|
||||
return 7
|
||||
return
|
||||
exit
|
||||
}
|
||||
|
||||
blabla
|
||||
|
||||
@@ -94,6 +94,11 @@ function do_subshell_error {
|
||||
"$BASEDIR/extra/library.bash"
|
||||
}
|
||||
|
||||
function do_command_error {
|
||||
>&2 echo nope is not defined!
|
||||
grep nope nope
|
||||
}
|
||||
|
||||
# FUNCTIONS
|
||||
|
||||
function call_function_which_will_exit {
|
||||
|
||||
Reference in New Issue
Block a user