Skip to content

Add backend server error handling for startup failures - #14

Open
srbot2016 wants to merge 1 commit into
visualbruno:mainfrom
srbot2016:main
Open

Add backend server error handling for startup failures#14
srbot2016 wants to merge 1 commit into
visualbruno:mainfrom
srbot2016:main

Conversation

@srbot2016

@srbot2016 srbot2016 commented Jul 30, 2026

Copy link
Copy Markdown

Problem

When the backend failed during startup, the application did not provide
the actual reason for the failure.

In my case, the backend startup was failing because Node.js could not
bind to the configured port:

Error: listen EACCES: permission denied 0.0.0.0:3001

However, without a server error handler, this failure was not surfaced
clearly. The Electron application only reported:

Backend startup failed: Backend did not start in time

This made diagnosing the issue much harder because the real networking
error was hidden.

Solution

Added an error listener to the backend HTTP server:

  • Captures Express/Node.js listen errors
  • Logs the original error details
  • Makes startup failures actionable instead of resulting in a generic timeout

Benefits

  • Easier debugging of backend startup failures
  • Clear visibility into port conflicts (EADDRINUSE)
  • Clear visibility into permission/reservation issues (EACCES)
  • Reduces time needed to diagnose deployment and local development issues

Testing

  • Started the backend locally
  • Verified that server startup errors are now reported with the original Node.js error details

…ort listen failures such as EACCES and EADDRINUSE.

Add an error handler to the Express backend server to capture and
report listen failures such as EACCES and EADDRINUSE.

Previously, when the backend failed to bind to its configured port,
the application only reported that the backend failed to start after
a timeout, without exposing the underlying Node.js error.

This change makes backend startup failures easier to diagnose by
logging the original server error details.
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.

1 participant