From ea92fbdcea5201ebe8b226952b6e6d2e601551be Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 30 Jan 2022 21:09:32 +0000 Subject: [PATCH] Give a filename instead of blob id in errors when possible. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3809 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/core.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/core.js b/core/core.js index d2385e34..0a9344c2 100644 --- a/core/core.js +++ b/core/core.js @@ -237,11 +237,13 @@ async function getProcessBlob(blobId, key, options) { process.task.setImports(imports); process.task.activate(); let source = await getBlobOrContent(blobId); + var appSourceName = blobId; var appSource = utf8Decode(source); try { var app = JSON.parse(appSource); if (app.type == "tildefriends-app") { - var id = app.files["app.js"]; + appSourceName = 'app.js'; + var id = app.files[appSourceName]; var blob = await getBlobOrContent(id); appSource = utf8Decode(blob); await Promise.all(Object.keys(app.files).map(async function(f) { @@ -256,7 +258,7 @@ async function getProcessBlob(blobId, key, options) { if (process.app) { process.app.send({action: "ready"}); } - await process.task.execute({name: blobId, source: appSource}); + await process.task.execute({name: appSourceName, source: appSource}); } catch (error) { if (process.app) { process.app.send({action: 'error', error: error});