From db9dfdde4571aec8b7814bc56de7c1e42eac27f6 Mon Sep 17 00:00:00 2001 From: Philipp Muens Date: Mon, 6 Jun 2016 15:42:40 +0200 Subject: [PATCH] Replace error throwing with Serverless error class --- lib/classes/PluginManager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/classes/PluginManager.js b/lib/classes/PluginManager.js index 69b96e0c7..4363b4d5e 100644 --- a/lib/classes/PluginManager.js +++ b/lib/classes/PluginManager.js @@ -35,7 +35,7 @@ class PluginManager { forEach(options, (value, key) => { if (value.required && (this.options[key] === true || !(this.options[key]))) { - throw new Error(`Please provide the "${key}" option`); + throw new this.serverless.classes.Error(`Please provide the "${key}" option`); } }); } @@ -61,7 +61,8 @@ class PluginManager { }); if (hooks.length === 0) { - throw new Error('The command you entered was not found. Did you spell it correctly?'); + throw new this.serverless.classes.Error('The command you entered was not found. ' + + 'Did you spell it correctly?'); } // using arr.reduce to sequentially run promises in array in order