Revert "- fix test: throw error when _runApp fails"

This reverts commit 17d2496c1b.
This commit is contained in:
denihs
2023-04-06 18:19:50 -04:00
parent 17d2496c1b
commit 53dbc453dc
3 changed files with 12 additions and 2 deletions

View File

@@ -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),

View File

@@ -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;

View File

@@ -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();