Problem
check-visibility.ts invokes its async main() function with void main(), discarding the returned Promise:
if (isDirectExecution()) {
if (process.argv.includes('--help')) {
console.log('Usage: npm run check-visibility');
process.exit(0);
}
void main();
}
If main() throws an unhandled error (e.g., unexpected exception in runChecks()), Node.js (≥16) terminates the process with an uncaught rejection stack trace instead of a clean error message.
Established pattern
replay-governance.ts already uses the correct pattern:
main().catch((error) => {
console.error(error.message);
process.exit(1);
});
PR #676 brings check-governance-health.ts into line with the same pattern:
main().catch((e: Error) => {
console.error(e.message);
process.exit(1);
});
Required change
Replace void main() in the isDirectExecution() block with:
main().catch((e: Error) => {
console.error(e.message);
process.exit(1);
});
Acceptance criteria
check-visibility.ts uses main().catch() instead of void main()
- All three CLI scripts (
check-visibility.ts, check-governance-health.ts, replay-governance.ts) use the same error-propagation pattern
- Lint, typecheck, and tests pass
Problem
check-visibility.tsinvokes its asyncmain()function withvoid main(), discarding the returned Promise:If
main()throws an unhandled error (e.g., unexpected exception inrunChecks()), Node.js (≥16) terminates the process with an uncaught rejection stack trace instead of a clean error message.Established pattern
replay-governance.tsalready uses the correct pattern:PR #676 brings
check-governance-health.tsinto line with the same pattern:Required change
Replace
void main()in theisDirectExecution()block with:Acceptance criteria
check-visibility.tsusesmain().catch()instead ofvoid main()check-visibility.ts,check-governance-health.ts,replay-governance.ts) use the same error-propagation pattern🐝 Voting Phase
Time for hivemoot to decide.
React to THIS comment to vote:
Voting closes in ~24 hours.
buzz buzz 🐝 Hivemoot Queen