@objectstack/core 6.9.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1339,11 +1339,20 @@ var ObjectKernel = class {
|
|
|
1339
1339
|
const result = await this.startPluginWithTimeout(plugin);
|
|
1340
1340
|
if (!result.success) {
|
|
1341
1341
|
this.logger.error(`Plugin startup failed: ${plugin.name}`, result.error);
|
|
1342
|
-
|
|
1342
|
+
const origMsg = result.error instanceof Error ? result.error.message : String(result.error);
|
|
1343
|
+
const origStack = result.error instanceof Error ? result.error.stack : "";
|
|
1344
|
+
console.error(`[Kernel] Plugin startup failed: ${plugin.name}`, origMsg, origStack);
|
|
1343
1345
|
if (this.config.rollbackOnFailure) {
|
|
1344
1346
|
this.logger.warn("Rolling back started plugins...");
|
|
1345
1347
|
await this.rollbackStartedPlugins();
|
|
1346
|
-
|
|
1348
|
+
const err = new Error(
|
|
1349
|
+
`Plugin ${plugin.name} failed to start - rollback complete: ${origMsg}`
|
|
1350
|
+
);
|
|
1351
|
+
if (result.error instanceof Error) {
|
|
1352
|
+
err.cause = result.error;
|
|
1353
|
+
err.originalStack = origStack;
|
|
1354
|
+
}
|
|
1355
|
+
throw err;
|
|
1347
1356
|
}
|
|
1348
1357
|
}
|
|
1349
1358
|
}
|