Skip to content

Commit

Permalink
Throw exception if there's no error listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Jan 7, 2016
1 parent 1b6f899 commit 35d5d00
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/run-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ RunContext.prototype._run = function () {
helpers.mockLocalConfig(this.generator, this.localConfig);
}

this.generator.on('error', this.emit.bind(this, 'error'));
this.generator.on('error', function (err) {
if (!this.emit('error', err)) {
throw err;
}
}.bind(this));
this.generator.once('end', function () {
helpers.restorePrompt(this.generator);
this.emit('end');
Expand Down

0 comments on commit 35d5d00

Please sign in to comment.