niti: write fatal error on stderr
authorJean Privat <jean@pryen.org>
Mon, 3 Dec 2012 03:52:44 +0000 (22:52 -0500)
committerJean Privat <jean@pryen.org>
Mon, 3 Dec 2012 04:39:13 +0000 (23:39 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/naive_interpreter.nit

index 48b517d..41fed1e 100644 (file)
@@ -576,10 +576,11 @@ redef class ANode
        private fun fatal(v: NaiveInterpreter, message: String)
        do
                if v.modelbuilder.toolcontext.opt_no_color.value == true then
-                       print("Runtime error: {message} ({location.file.filename}:{location.line_start})")
+                       stderr.write("Runtime error: {message} ({location.file.filename}:{location.line_start})\n")
                else
-                       print("{location}: Runtime error: {message}\n{location.colored_line("0;31")}")
-                       print(v.stack_trace)
+                       stderr.write("{location}: Runtime error: {message}\n{location.colored_line("0;31")}\n")
+                       stderr.write(v.stack_trace)
+                       stderr.write("\n")
                end
                exit(1)
        end