[Fai-commit] r4739 - trunk/lib
lange at alioth.debian.org
lange at alioth.debian.org
Wed Nov 14 10:21:34 UTC 2007
Author: lange
Date: 2007-11-14 10:21:33 +0000 (Wed, 14 Nov 2007)
New Revision: 4739
Modified:
trunk/lib/subroutines
Log:
save function name that causes fatal error
Modified: trunk/lib/subroutines
===================================================================
--- trunk/lib/subroutines 2007-11-14 10:18:36 UTC (rev 4738)
+++ trunk/lib/subroutines 2007-11-14 10:21:33 UTC (rev 4739)
@@ -99,9 +99,8 @@
stop_fai_installation() {
# this subroutine should directly stop the installation process
- echo "FATAL ERROR. Installation stopped."
- echo "Currently I do not know how to stop."
- exit 9999
+ echo "Traceback: $task_error_func"
+ die "FATAL ERROR. Installation stopped."
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### BEGIN SUBROUTINE INFO
@@ -114,7 +113,7 @@
task_error() {
[ X$2 = X0 ] && return
- echo "Error $1. Traceback: ${FUNCNAME[*]}"
+ task_error_func=${FUNCNAME[*]}
[ $1 -gt $task_error ] && task_error=$1
[ $task_error -gt $STOP_ON_ERROR ] && stop_fai_installation
}
@@ -144,6 +143,7 @@
echo "Calling task_$taskname"
sendmon "TASKBEGIN $taskname"
task_error=0 # task can set this variable to indicate an error
+ task_error_func=''
task_$taskname
sendmon "TASKEND $taskname $task_error"
[ "$task_error" -ne 0 ] && echo "Exit code task_$taskname: $task_error"
More information about the Fai-commit
mailing list