mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix handling unexpected errors during build
This commit is contained in:
@@ -3295,17 +3295,13 @@ async function bundle({
|
||||
buildMode: buildOptions.buildMode
|
||||
});
|
||||
|
||||
try {
|
||||
await client.make({
|
||||
packages: [app],
|
||||
minifyMode: minifyMode,
|
||||
minifiers: options.minifiers || [],
|
||||
addCacheBusters: true,
|
||||
onJsOutputFiles,
|
||||
});
|
||||
} catch (e) {
|
||||
// it's fine to fail here, but we don't want to propagate the error
|
||||
}
|
||||
await client.make({
|
||||
packages: [app],
|
||||
minifyMode: minifyMode,
|
||||
minifiers: options.minifiers || [],
|
||||
addCacheBusters: true,
|
||||
onJsOutputFiles,
|
||||
});
|
||||
|
||||
return client;
|
||||
});
|
||||
|
||||
@@ -405,7 +405,15 @@ Object.assign(AppRunner.prototype, {
|
||||
|
||||
self.isRunning = true;
|
||||
global.asyncLocalStorage.run({}, () =>
|
||||
self._runApp().catch((e) => self._resolvePromise("start", e))
|
||||
self._runApp()
|
||||
.catch((e) => {
|
||||
// There was an unexpected error when building the app
|
||||
// This is not recoverable, so we turn it into an unhandled exception
|
||||
// and crash.
|
||||
setTimeout(() => {
|
||||
throw e;
|
||||
});
|
||||
})
|
||||
);
|
||||
await self.startPromise;
|
||||
self.startPromise = null;
|
||||
@@ -435,9 +443,6 @@ Object.assign(AppRunner.prototype, {
|
||||
ee.emit(name, value);
|
||||
this._promiseResolvers[name] = null;
|
||||
}
|
||||
if (value instanceof Error) {
|
||||
throw value;
|
||||
}
|
||||
},
|
||||
|
||||
_cleanUpPromises: function () {
|
||||
|
||||
Reference in New Issue
Block a user