mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2025-01-03 17:31:58 +03:00
Trigger build error from read file batch functions.
This commit is contained in:
parent
669a20dfe9
commit
3d3b7be40b
@ -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<Object>}
|
||||
*/
|
||||
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 },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user