diff --git a/packages/core/src/runtime/actor.ts b/packages/core/src/runtime/actor.ts index 0296fb0..0a617f2 100644 --- a/packages/core/src/runtime/actor.ts +++ b/packages/core/src/runtime/actor.ts @@ -158,7 +158,13 @@ export class Actor { if (!reason.ok) { console.error(`${this} crashed:`, reason.err); } - this.exitHooks.forEach(hook => hook()); + this.exitHooks.forEach(hook => { + try { + hook(); + } catch (e) { + console.error(`${this} exit hook ${hook} failed:`, e); + } + }); this.root._terminate(reason.ok); this.space.deregister(this); }