add some catch blocks
r3712 | dcl | 2012-08-28 15:12:57 +1000 (Tue, 28 Aug 2012) | 1 line
This commit is contained in:
@@ -1,16 +1,32 @@
|
||||
namespace eval ::utility {}
|
||||
proc ::utility::writeNode {tc_root { do_props 0 } { level 0 }} {
|
||||
if [ catch {
|
||||
set space [string repeat " " $level]
|
||||
if [ catch {
|
||||
set val [hval $tc_root]
|
||||
} message ] {
|
||||
clientput "Error in writeNode/hval for $tc_root : $message"
|
||||
return
|
||||
}
|
||||
set nam [lindex [split $tc_root "/"] end]
|
||||
if [ catch {
|
||||
if {"$val" == ""} {
|
||||
set line "$nam ([hinfo $tc_root])"
|
||||
} else {
|
||||
set line "$nam ([hinfo $tc_root]) = $val"
|
||||
}
|
||||
} message ] {
|
||||
clientput "Error in writeNode/hinfo for $tc_root : $message"
|
||||
return
|
||||
}
|
||||
clientput "$space* $line"
|
||||
if {"[string tolower "$do_props"]" == "-prop"} {
|
||||
if [ catch {
|
||||
set props [hlistprop $tc_root]
|
||||
} message ] {
|
||||
clientput "Error in writeNode/hlistprop for $tc_root : $message"
|
||||
return
|
||||
}
|
||||
#clientput "<<$props>>"
|
||||
foreach prop $props {
|
||||
#clientput "prop: $prop"
|
||||
@@ -31,6 +47,9 @@
|
||||
foreach node [hlist $tc_root] {
|
||||
::utility::writeNode $tc_root/$node "$do_props" [expr {$level + 1}]
|
||||
}
|
||||
} message ] {
|
||||
clientput "Error in writeNode for $tc_root : $message"
|
||||
}
|
||||
}
|
||||
|
||||
proc writeTree {tc_root {do_props 0}} {
|
||||
|
||||
Reference in New Issue
Block a user