From fb71a0a0dddf68fa3f266aab5e35409773acc567 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Harboe?= Date: Mon, 11 Jan 2010 12:54:49 +0100 Subject: [PATCH] reset: better error messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use correct tcl syntax to throw exception. the syntax is "return -code error" not "return -error" Signed-off-by: Øyvind Harboe --- src/target/startup.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target/startup.tcl b/src/target/startup.tcl index b597b84d15..d68417e808 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] } } } -- 2.30.2