Print error messages to stderr, not stdout
This commit is contained in:
@@ -63,16 +63,16 @@ class Kiss {
|
||||
try {
|
||||
return operation();
|
||||
} catch (err:CompileError) {
|
||||
Sys.println(err);
|
||||
Sys.stderr().writeString(err + "\n");
|
||||
Sys.exit(1);
|
||||
return null;
|
||||
} catch (err:UnmatchedBracketSignal) {
|
||||
Sys.println(Stream.toPrint(err.position) + ': Unmatched ${err.type}');
|
||||
Sys.stderr().writeString(Stream.toPrint(err.position) + ': Unmatched ${err.type}\n');
|
||||
Sys.exit(1);
|
||||
return null;
|
||||
} catch (err:Exception) {
|
||||
Prelude.print("Error: " + err.message);
|
||||
Prelude.print(err.stack.toString());
|
||||
Sys.stderr().writeString("Error: " + err.message + "\n");
|
||||
Sys.stderr().writeString(err.stack.toString() + "\n");
|
||||
Sys.exit(1);
|
||||
return null;
|
||||
}
|
||||
|
@@ -99,8 +99,8 @@ class Reader {
|
||||
public static function nextToken(stream:Stream, expect:String) {
|
||||
var tok = stream.expect(expect, () -> stream.takeUntilOneOf(terminators));
|
||||
if (tok.length == 0) {
|
||||
Sys.println('Kiss reader error!');
|
||||
Sys.println(stream.position().toPrint() + ': Expected $expect');
|
||||
Sys.stderr().writeString('Kiss reader error!\n');
|
||||
Sys.stderr().writeString(stream.position().toPrint() + ': Expected $expect\n');
|
||||
Sys.exit(1);
|
||||
}
|
||||
return tok;
|
||||
|
Reference in New Issue
Block a user