diff --git a/tools/cli/commands.js b/tools/cli/commands.js index 2aaad1708b..d0cd3c1f39 100644 --- a/tools/cli/commands.js +++ b/tools/cli/commands.js @@ -424,6 +424,7 @@ async function doRunCommand(options) { import { CordovaProject } from '../cordova/project.js'; await main.captureAndExit('', 'preparing Cordova project', async () => { + // TODO -> Have to change CordovaProject constructor here. const cordovaProject = new CordovaProject(projectContext, { settingsFile: options.settings, mobileServerUrl: utils.formatUrl(parsedMobileServerUrl), diff --git a/tools/runners/run-app.js b/tools/runners/run-app.js index 1dfa5b2755..40d9d2de01 100644 --- a/tools/runners/run-app.js +++ b/tools/runners/run-app.js @@ -408,7 +408,6 @@ Object.assign(AppRunner.prototype, { await self._runApp(); } catch (e) { self._resolvePromise("start", e); - throw e; } finally { await self.startPromise; self.startPromise = null; diff --git a/tools/utils/buildmessage.js b/tools/utils/buildmessage.js index 18b7f1459a..3df1b206ce 100644 --- a/tools/utils/buildmessage.js +++ b/tools/utils/buildmessage.js @@ -279,7 +279,17 @@ async function capture(options, f) { } try { - await f(); + // you can think that this is as simple as: + // await f(); + // but we need to make sure that we are not leaking a thrown error + // the next call to capture. + await new Promise(async (resolve) => { + try { + await f(); + } finally { + resolve(); + } + }); } finally { progress.reportProgressDone();