Catch errors in the hval/hget and return the message as the value

This commit is contained in:
Douglas Clowes
2014-05-26 12:53:55 +10:00
parent f62fb5a91c
commit 6a9b64d3d6
2 changed files with 15 additions and 3 deletions

View File

@ -81,7 +81,11 @@ proc test_suite::make_nodes {path result indent} {
append result "$prefix<component id=\"$nodename\" dataType=\"$type\">\n"
if {[string compare -nocase $type "none"] != 0} {
set value [test_suite::encode [hval $path]]
if [ catch {
set value [test_suite::encode [hval $path]]
} message ] {
set value "HVAL_ERROR:${message}"
}
append result "$prefix <value>$value</value>\n"
}
foreach p [test_suite::property_elements $path $newIndent] {

View File

@ -62,7 +62,11 @@ proc make_nodes {path result indent} {
if {"$control" == "true"} {
append result "$prefix<component id=\"$nodename\" dataType=\"$type\">\n"
if {[string compare -nocase $type "none"] != 0} {
set value [encode [hval $path]]
if [ catch {
set value [encode [hval $path]]
} message ] {
set value "HVAL_ERROR:${message}"
}
append result "$prefix <value>$value</value>\n"
}
foreach p [property_elements $path $newIndent] {
@ -126,7 +130,11 @@ proc make_value_nodes {path result indent} {
if {"$control" == "true"} {
append result "$prefix<component id=\"$nodename\" dataType=\"$type\">\n"
if {[string compare -nocase $type "none"] != 0} {
set value [encode [hval $path]]
if [ catch {
set value [encode [hval $path]]
} message ] {
set value "HVAL_ERROR:${message}"
}
append result "$prefix <value>$value</value>\n"
}
foreach x [hlist $path] {