mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 22:02:00 +01:00
Print a terse stack trace for unexpected errors.
This commit is contained in:
parent
1f4596ff6a
commit
0a8633735a
@ -53,13 +53,23 @@ void main(List<String> args) {
|
||||
|
||||
if (options['trace']) {
|
||||
stderr.writeln();
|
||||
stderr.write(new Trace.from(stackTrace).toString());
|
||||
stderr.write(new Trace.from(stackTrace).terse.toString());
|
||||
stderr.flush();
|
||||
}
|
||||
|
||||
// Exit code 65 indicates invalid data per
|
||||
// http://www.freebsd.org/cgi/man.cgi?query=sysexits.
|
||||
exit(65);
|
||||
} catch (error, stackTrace) {
|
||||
if (options['color']) stderr.write('\u001b[31m\u001b[1m');
|
||||
stderr.write('Unexpected exception:');
|
||||
if (options['color']) stderr.write('\u001b[0m');
|
||||
stderr.writeln();
|
||||
|
||||
stderr.writeln(error);
|
||||
stderr.writeln();
|
||||
stderr.write(new Trace.from(stackTrace).terse.toString());
|
||||
stderr.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user