From 4b604334259e46ee7eebd95792ae39f11036644e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 27 Sep 2019 08:13:29 -0700 Subject: [PATCH] Add warning when config parsing fails Summary: This can quite easily happen if you manually edit it and aren't careful. The least we can do is tell the user about it, because it be a bit surprising otherwise. Reviewed By: jknoxville Differential Revision: D17626760 fbshipit-source-id: 8c7d64b041fa4b97ce2753116800d0e855442dd9 --- static/setup.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/setup.js b/static/setup.js index 5cc3fb4cc..c528e3ad6 100644 --- a/static/setup.js +++ b/static/setup.js @@ -41,6 +41,8 @@ module.exports = function(argv) { }; } catch (e) { // file not readable or not parsable, overwrite it with the new config + console.warn(`Failed to read ${configPath}: ${e}`); + console.info('Writing new default config.'); fs.writeFileSync(configPath, JSON.stringify(config)); }