Commit e5a717e
committed
feat(devframe): add onServerError for post-bind server errors
startHttpAndWs's owned httpServer has no error listener once past the
bind window, so a later runtime error (e.g. a transient EMFILE while
accepting a connection) crashes the process. StartedServer exposes no
handle a caller could attach their own listener to either, unlike the
shared-server path where the caller already owns the object.
Add onServerError instead of exposing the raw httpServer — handing
out the raw object would let a caller call close() on it directly,
bypassing the wrapper's own close() and leaking the WS transport.
Attached only after the bind has already succeeded, so this never
touches bind-time crash/hang semantics — only what happens afterward.
No test: StartedServer deliberately doesn't expose the raw server, so
there's no way to trigger a genuine post-bind error through the
public API without a test-only seam.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 5669caf commit e5a717e
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
258 | 266 | | |
259 | 267 | | |
260 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
261 | 273 | | |
262 | 274 | | |
263 | 275 | | |
| |||
0 commit comments