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