From 35d5d008df254e46a47b7ff213f8943975424185 Mon Sep 17 00:00:00 2001 From: Simon Boudrias Date: Wed, 6 Jan 2016 19:32:37 -0500 Subject: [PATCH] Throw exception if there's no error listeners --- lib/run-context.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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');