Add a try catch for killApp in render.

This commit is contained in:
Dillon Kearns 2022-03-31 09:06:17 -07:00
parent 40ffea6ce9
commit b4dc540cc2

View File

@ -188,8 +188,10 @@ function runElmApp(
app.ports.sendPageData.subscribe(portHandler);
}).finally(() => {
addDataSourceWatcher(patternsToWatch);
killApp();
killApp = null;
try {
killApp();
killApp = null;
} catch (error) {}
});
}
/**
@ -327,11 +329,11 @@ async function readFileJobNew(req, patternsToWatch) {
patternsToWatch.add(filePath);
const fileContents = // TODO can I remove this hack?
(
await fsPromises.readFile(
path.join(process.env.LAMBDA_TASK_ROOT || process.cwd(), filePath)
)
).toString();
(
await fsPromises.readFile(
path.join(process.env.LAMBDA_TASK_ROOT || process.cwd(), filePath)
)
).toString();
const parsedFile = matter(fileContents);
return jsonResponse(req, {