Add error handling for unspecified layout

This commit is contained in:
ismay 2015-08-08 13:31:43 +02:00
parent 05d80a76a0
commit 6986a9b938

View file

@ -107,6 +107,11 @@ function plugin(opts){
debug('converting file: %s', file);
var data = files[file];
// Require a default or a layout to be specified for each file
if(!data.layout && !def) {
throw new Error('No layout specified for ' + file);
}
// Deep clone params (by passing 'true')
var clonedParams = extend(true, {}, params);
var clone = extend({}, clonedParams, metadata, data);