Diff
Not logged in

Differences From:

File tools/cvs2fossil/lib/trouble.tcl part of check-in [d57b7b4a05] - Re-added the user feedback and error reporting utilities, with modifications, and completed the handling of the informational options. by aku on 2007-10-02 05:33:09. [view]

To:

File tools/cvs2fossil/lib/trouble.tcl part of check-in [591151532206c] - Added the pass management, integrated with application and option processor. by aku on 2007-10-02 06:48:55. [view]

@@ -25,11 +25,16 @@
 snit::type ::vc::tools::trouble {
     # # ## ### ##### ######## #############
     ## Public API, Methods
 
+    typemethod internal {text} {
+	foreach line [split $text \n] { $type fatal "INTERNAL ERROR! $line" }
+	exit 1
+    }
+
     typemethod fatal {text} {
 	lappend myfatal $text
-	exit 1
+	return
     }
 
     typemethod warn {text} {
 	lappend mywarn $text
@@ -46,8 +51,18 @@
 	foreach m $myinfo  { log write 0 ""      $m }
 	foreach m $mywarn  { log write 0 warning $m }
 	foreach m $myfatal { log write 0 fatal   $m }
 	return
+    }
+
+    typemethod abort? {} {
+	if {
+	    ![llength $myinfo] &&
+	    ![llength $mywarn] &&
+	    ![llength $myfatal]
+	} return
+	# We have error messages to print, so stop.
+	exit 1
     }
 
     # # ## ### ##### ######## #############
     ## Internal, state