Generate code to report errors in script context hook code
This commit is contained in:
@ -768,6 +768,10 @@ def put_write_function(MyDriver, func):
|
|||||||
txt += ['# hook code starts']
|
txt += ['# hook code starts']
|
||||||
txt += MyDriver['Funcs'][func]['text']
|
txt += MyDriver['Funcs'][func]['text']
|
||||||
txt += ['# hook code ends']
|
txt += ['# hook code ends']
|
||||||
|
txt += [' if { [hpropexists [sct] geterror] } {']
|
||||||
|
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
|
||||||
|
txt += [' return -code error "[sct geterror]"']
|
||||||
|
txt += [' }']
|
||||||
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
|
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
|
||||||
txt += [' sct send "${cmd}"']
|
txt += [' sct send "${cmd}"']
|
||||||
txt += [' return ${nextState}']
|
txt += [' return ${nextState}']
|
||||||
@ -800,6 +804,10 @@ def put_fetch_function(MyDriver, func):
|
|||||||
txt += ['# hook code starts']
|
txt += ['# hook code starts']
|
||||||
txt += MyDriver['Funcs'][func]['text']
|
txt += MyDriver['Funcs'][func]['text']
|
||||||
txt += ['# hook code ends']
|
txt += ['# hook code ends']
|
||||||
|
txt += [' if { [hpropexists [sct] geterror] } {']
|
||||||
|
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
|
||||||
|
txt += [' return -code error "[sct geterror]"']
|
||||||
|
txt += [' }']
|
||||||
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
|
txt += [' debug_log 1 "%s sct send ${cmd}"' % func]
|
||||||
txt += [' sct send "${cmd}"']
|
txt += [' sct send "${cmd}"']
|
||||||
txt += [' return ${nextState}']
|
txt += [' return ${nextState}']
|
||||||
@ -825,10 +833,10 @@ def put_read_function(MyDriver, func):
|
|||||||
txt += ['# hook code starts']
|
txt += ['# hook code starts']
|
||||||
txt += MyDriver['Funcs'][func]['text']
|
txt += MyDriver['Funcs'][func]['text']
|
||||||
txt += ['# hook code ends']
|
txt += ['# hook code ends']
|
||||||
txt += [' if { [hpropexists [sct] geterror] } {']
|
txt += [' if { [hpropexists [sct] geterror] } {']
|
||||||
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
|
txt += [' debug_log 1 "[sct] error: [sct geterror]"']
|
||||||
txt += [' return -code error "[sct geterror]"']
|
txt += [' return -code error "[sct geterror]"']
|
||||||
txt += [' }']
|
txt += [' }']
|
||||||
txt += [' if { ${data} != [sct oldval] } {']
|
txt += [' if { ${data} != [sct oldval] } {']
|
||||||
txt += [' debug_log 1 "[sct] changed to new:${data}, from old:[sct oldval]"']
|
txt += [' debug_log 1 "[sct] changed to new:${data}, from old:[sct oldval]"']
|
||||||
txt += [' sct oldval ${data}']
|
txt += [' sct oldval ${data}']
|
||||||
|
Reference in New Issue
Block a user