Commit 99ebb0d
fix: detect port-in-use before starting (#1234)
Add a port availability pre-check before starting the whistle server.
When the port is already in use, output a friendly error message to
stderr and exit, instead of crashing with an uncaught exception.
Compared to the previous attempt (PR #1313), this fix:
- Works for all startup modes, not just cluster mode
- Uses console.error + process.exit instead of throw in async callback
- Does not include unrelated changes (cluster mode, config loading, etc.)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 6ff0305 commit 99ebb0d
1 file changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
| |||
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
78 | | - | |
79 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
80 | 105 | | |
0 commit comments