Skip to content

Commit ddd9588

Browse files
juggyindexzero
authored andcommitted
When an uncaught exception is caught in watch mode, print it in the console and continue watch.
1 parent ddf3cf4 commit ddd9588

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bin/vows

+2-3
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ if (args.length === 0 || options.watch) {
194194
abort("runner", "couldn't find test folder");
195195
}
196196
msg('bin', 'discovered', "./" + testFolder);
197-
198197
if (args.length === 0) {
199198
args = paths(testFolder).filter(function (f) {
200199
return new(RegExp)('(-|_)' + testFolder + '.(js|coffee)$').test(f);
@@ -280,8 +279,7 @@ if (! options.watch) {
280279
lastRun,
281280
colors = ['32m', '33m', '31m'],
282281
timer = setInterval(tick, 100);
283-
284-
process.on('uncaughtException', cleanup);
282+
process.on('uncaughtException', exception);
285283
process.on('exit', cleanup);
286284
process.on('SIGINT', function () {
287285
process.exit(0);
@@ -321,6 +319,7 @@ if (! options.watch) {
321319
function cursorHide() { esc("?25l") }
322320
function cursorShow() { esc("?25h") }
323321
function cleanup() { eraseLine(), cursorShow(), clearInterval(timer), print('\n') }
322+
function exception(err) { print(err.stack || err.message || JSON.stringify(err)), running = 0}
324323

325324
//
326325
// Get a matching test for a given file

0 commit comments

Comments
 (0)