summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-01-11 12:54:49 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-01-11 12:58:06 +0100
commitfb71a0a0dddf68fa3f266aab5e35409773acc567 (patch)
tree40e3b28e6b488cb53cb844f8063e18316c4be017 /src/target
parent6d8604de37855da6e9acf79adbb488788bdc9917 (diff)
downloadopenocd_libswd-fb71a0a0dddf68fa3f266aab5e35409773acc567.tar.gz
openocd_libswd-fb71a0a0dddf68fa3f266aab5e35409773acc567.tar.bz2
openocd_libswd-fb71a0a0dddf68fa3f266aab5e35409773acc567.tar.xz
openocd_libswd-fb71a0a0dddf68fa3f266aab5e35409773acc567.zip
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>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/startup.tcl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/target/startup.tcl b/src/target/startup.tcl
index b597b84d..d68417e8 100644
--- a/src/target/startup.tcl
+++ b/src/target/startup.tcl
@@ -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]
}
}
}