Replace error throwing with Serverless error class

This commit is contained in:
Philipp Muens 2016-06-06 15:42:40 +02:00
parent 90c4feeca5
commit db9dfdde45

View File

@ -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