From 406ba5ab14d3a568282112f0e6874f208e8f6433 Mon Sep 17 00:00:00 2001 From: Daniel Stockman Date: Tue, 19 Nov 2019 13:45:13 -0800 Subject: [PATCH] fix(conventional-commits): Ensure potential `ValidationError` in `getChangelogConfig()` is propagated correctly --- core/conventional-commits/lib/recommend-version.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/conventional-commits/lib/recommend-version.js b/core/conventional-commits/lib/recommend-version.js index 7274c5f469..f13ae56df9 100644 --- a/core/conventional-commits/lib/recommend-version.js +++ b/core/conventional-commits/lib/recommend-version.js @@ -35,7 +35,11 @@ function recommendVersion(pkg, type, { changelogPreset, rootPath, tagPrefix, pre } }; - return getChangelogConfig(changelogPreset, rootPath).then(config => { + // Ensure potential ValidationError in getChangelogConfig() is propagated correctly + let chain = Promise.resolve(); + + chain = chain.then(() => getChangelogConfig(changelogPreset, rootPath)); + chain = chain.then(config => { // "new" preset API options.config = config; @@ -61,4 +65,6 @@ function recommendVersion(pkg, type, { changelogPreset, rootPath, tagPrefix, pre }); }); }); + + return chain; }