Catch errors in hooks
@@ -126,8 +126,15 @@ namespace eval turbine {
}
global env
if [ info exists env(TURBINE_LEADER_HOOK_STARTUP) ] {
- log "TURBINE_LEADER_HOOK_STARTUP: $env(TURBINE_LEADER_HOOK_STARTUP)"
+ puts "TURBINE_LEADER_HOOK_STARTUP: $env(TURBINE_LEADER_HOOK_STARTUP)"
+ try {
eval $env(TURBINE_LEADER_HOOK_STARTUP)
+ } on error e {
+ puts ""
+ puts "Error in TURBINE_LEADER_HOOK_STARTUP: $e"
+ puts ""
+ exit 1
+ }
}
}
@@ -138,8 +145,15 @@ namespace eval turbine {
}
global env
if [ info exists env(TURBINE_LEADER_HOOK_SHUTDOWN) ] {
- log "TURBINE_LEADER_HOOK_SHUTDOWN: $env(TURBINE_LEADER_HOOK_SHUTDOWN)"
+ puts "TURBINE_LEADER_HOOK_SHUTDOWN: $env(TURBINE_LEADER_HOOK_SHUTDOWN)"
+ try {
eval $env(TURBINE_LEADER_HOOK_SHUTDOWN)
+ } on error e {
+ puts ""
+ puts "Error in TURBINE_LEADER_HOOK_SHUTDOWN: $e"
+ puts ""
+ exit 1
+ }
}
}
}
