From 6986a9b938207cfa6466aa3afa4f0ee43570b541 Mon Sep 17 00:00:00 2001 From: ismay Date: Sat, 8 Aug 2015 13:31:43 +0200 Subject: [PATCH] Add error handling for unspecified layout --- lib/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/index.js b/lib/index.js index dcd1647..182f8ea 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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);