From 94585e7ca108c5553978340871a8e352cdb7e532 Mon Sep 17 00:00:00 2001 From: Jaid Date: Thu, 31 Jan 2019 01:58:07 +0100 Subject: [PATCH] Improved error handling --- src/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 90e2a04..ad8bba1 100644 --- a/src/index.js +++ b/src/index.js @@ -162,7 +162,14 @@ export default class { ]) const jsdocJobs = [htmlConfigPath, tsdConfigPath].map(configPath => exec(`node "${jsdocPath}" --configure "${configPath}"`)) - await Promise.all(jsdocJobs) + + const jsdocResults = await Promise.all(jsdocJobs) + + for (const jsdocResult of jsdocResults) { + if (jsdocResult.stderr) { + throw new Error(`JSDoc failed: ${jsdocResult.stderr}`) + } + } if (this.options.autoTsdOutputFile) { const tsdContent = fs.readFileSync(this.options.autoTsdOutputFile)