Skip to content

Conversation

@dmanto
Copy link
Contributor

@dmanto dmanto commented Nov 12, 2025

Fixes #175

Makes startup hooks (onStart, server:start, etc.) exit with code 1 on error instead of 0.

This preserves test compatibility (detectImport: false) and doesn't affect runtime route errors (which correctly return 500).

this.log.error(error.message);
if (this.detectImport !== false) {
process.exit(1);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the usual style for the surrounding code here is:

if (this.detectImport !== false) process.exit(1);

Copy link
Contributor Author

@dmanto dmanto Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. Before updating the code, let me comment that the format you suggested aligns with an ESLint rule, and running it, even in the same file (like npx eslint src/app.ts --rule "curly: [2,'multi']") would show many style inconsistences (i.e., besides this one in line 506). Please let me know what you think.

@dmanto
Copy link
Contributor Author

dmanto commented Dec 5, 2025

Could you take another look at my PR when you have a moment? Happy to make any remaining changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Startup hooks exit with code 0 on error, breaking systemd/Docker

2 participants