Unhandled EADDRINUSE when the configured port is in use (multi-vault) — proposed fix + UX #291
BozhengLong
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When the REST API server's configured port is already in use,
_refreshServerState()callsserver.listen()with no'error'handler, so anEADDRINUSEsurfaces as an uncaught exception and the API silently fails to start. This is easy to hit whenever more than one vault has the plugin enabled, because ports are a per-vault setting but every vault defaults to the same values (27124 / 27123).Steps to reproduce
Why it matters
Multi-vault users get a silently dead API with no indication of what happened or how to fix it.
What I'd like to contribute
I have a fix ready (with tests; lint/typecheck/build green) and wanted to confirm scope before opening a PR, per
CONTRIBUTING.md. The change has two layers:'error'handler soEADDRINUSE(and other bind errors) no longer throw uncaught, and surface a clear message instead of failing silently.Question
Is the full direction (bug fix + self-service UX) welcome, or would you prefer just the minimal error handling (layer 1)? Happy to scope the PR to whatever fits the project's goals. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions