reset: better error messages

Use correct tcl syntax to throw exception.

the syntax is "return -code error" not "return -error"

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe 2010-01-11 12:54:49 +01:00
parent 6d8604de37
commit fb71a0a0dd
1 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ proc ocd_process_reset_inner { MODE } {
set halt 0;
}
if { $halt < 0 } {
return -error "Invalid mode: $MODE, must be one of: halt, init, or run";
return -code error "Invalid mode: $MODE, must be one of: halt, init, or run";
}
# Target event handlers *might* change which TAPs are enabled
@ -119,7 +119,7 @@ proc ocd_process_reset_inner { MODE } {
set s [$t curstate]
if { 0 != [string compare $s "halted" ] } {
return -error [format "TARGET: %s - Not halted" $t]
return -code error [format "TARGET: %s - Not halted" $t]
}
}
}