diff --git a/lib/run-context.js b/lib/run-context.js index bfef074..69adb55 100644 --- a/lib/run-context.js +++ b/lib/run-context.js @@ -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');