proc handler { args } {
if { [catch {eval $args} errorMessage] } {
_report_error "$errorMessage"
}
}
args is script which has call from another TCL file
proc is_threshold_percent {thresholdValue } {
#some code here
if { [ string is double -strict $threshold ] && $threshold < 0 } {
error "Threshold ${threshold}% must be positive."
}
return 1
}
return 0
}
Without catch block it;s normally printed error and program exits with an error, but I need handle the error message and add more details and catch block ignores the error and finishes 'normally' .