From 3d3b7be40b0bd472504586c7c58c52227575540b Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Wed, 14 Jul 2021 09:04:45 -0700 Subject: [PATCH] Trigger build error from read file batch functions. --- generator/src/render.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/generator/src/render.js b/generator/src/render.js index d7aaed84..40981775 100755 --- a/generator/src/render.js +++ b/generator/src/render.js @@ -180,7 +180,7 @@ function jsonOrNull(string) { async function runJob(app, filePath) { pendingDataSourceCount += 1; - pendingDataSourceResponses.push(await readFileTask(filePath)); + pendingDataSourceResponses.push(await readFileTask(app, filePath)); pendingDataSourceCount -= 1; flushIfDone(app); } @@ -284,7 +284,7 @@ function flushQueue(app) { * @param {string} filePath * @returns {Promise} */ -async function readFileTask(filePath) { +async function readFileTask(app, filePath) { // console.log(`Read file ${filePath}`); try { const fileContents = ( @@ -316,8 +316,10 @@ async function readFileTask(filePath) { }), }; } catch (e) { - console.log(`Error reading file at '${filePath}'`); - throw e; + app.ports.fromJsPort.send({ + tag: "BuildError", + data: { filePath }, + }); } }