Skip to content

Commit e48d16a

Browse files
committed
[exercises/runner.js] Print real stack trace for errors rather than helper messages.
Helper messages seem to often point at the wrong source of the problem.
1 parent f22ef4a commit e48d16a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

exercises/runner.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@ function runner() {
1717

1818
exercise.addProcessor(function(mode, callback) {
1919
__ = exercise.__.bind(exercise)
20+
var testFile = this.args[0]
2021
try {
21-
submittedFx = require(path.resolve(process.cwd(), this.args[0]));
22+
submittedFx = require(path.resolve(process.cwd(), testFile));
2223
} catch (e) {
23-
var message = (e.code === 'MODULE_NOT_FOUND'
24-
? __('fail.module_not_found')
25-
: __('fail.missing_deps'))
26-
27-
this.emit('fail', message)
28-
return callback(null, false)
24+
this.emit('fail', e.stack)
25+
return callback(e, false)
2926
}
3027

3128
if (typeof submittedFx !== 'function') {

0 commit comments

Comments
 (0)