Merges from ics1-wombat

r2834 | ffr | 2009-12-09 17:07:45 +1100 (Wed, 09 Dec 2009) | 2 lines
This commit is contained in:
Ferdi Franceschini
2009-12-09 17:07:45 +11:00
committed by Douglas Clowes
parent 64ab146a44
commit c73c4c85c8
15 changed files with 3779 additions and 209 deletions

View File

@@ -1,7 +1,7 @@
# Some useful functions for SICS configuration.
# $Revision: 1.22 $
# $Date: 2009-11-24 22:56:49 $
# $Revision: 1.23 $
# $Date: 2009-12-09 06:07:45 $
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
# Last revision by $Author: ffr $
@@ -871,6 +871,47 @@ proc hsibPath {sibling} {
}
proc hsibPath {sibling} {
set hpath [sct]
return [file dirname $hpath]/$sibling
}
##
# @brief Handle exceptions caught by a 'catch' command.
# Note: You must use 'error' not 'return -code error' to
# raise errors from within a catch block.
#
# @param status, the status returned by the 'catch' command.
# @param message, the message set by the 'catch' command.
#
# Call this as the last command in the command block or
# for loop which encloses the 'catch'
proc handle_exception {status message} {
switch $status {
0 {
# TCL_OK, This is raised when you just drop out of the
# bottom of a 'catch' command.
return -code ok
}
1 {
# TCL_ERROR
return -code error "([info level -1]) $message"
}
2 {
# TCL_RETURN
return -code return "$message"
}
3 {
# TCL_BREAK
return -code break
}
4 {
# TCL_CONTINUE
return -code continue
}
default {
# Propogate user defined return codes with message
return -code $status "$message"
}
}
}
namespace import ::utility::*;