From f8ed422ed179c62eaecd8502a3a57e85a7b3c9d8 Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 5 Feb 2018 15:37:22 -0700 Subject: [PATCH] [config] throw if config file has a syntax error (#65) --- packages/kbn-plugin-helpers/lib/config_file.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/kbn-plugin-helpers/lib/config_file.js b/packages/kbn-plugin-helpers/lib/config_file.js index df1bbce98e00b29..814ac7239bd23da 100644 --- a/packages/kbn-plugin-helpers/lib/config_file.js +++ b/packages/kbn-plugin-helpers/lib/config_file.js @@ -19,13 +19,16 @@ module.exports = function (root) { const content = JSON.parse(readFileSync(resolve(root, configFile))); config = Object.assign(config, content); } catch (e) { - // noop + // rethrow error unless it's complaining about file not existing + if (e.code !== 'ENOENT') { + throw e; + } } }); const deprecationMsg = 'has been removed from `@elastic/plugin-helpers`. ' + 'During development your plugin must be located in `../kibana-extra/{pluginName}` ' + - 'relative to the Kibana directory to work with this package.\n' + 'relative to the Kibana directory to work with this package.\n'; if (config.kibanaRoot) { throw new Error(