Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Jan 8, 2026

Problem

When port 8969 is in use, the retry logic silently retries and can still fail after 3 attempts with an unhandled rejection, providing poor user experience.

Solution

  • Enhanced retry logging: Shows attempt number (e.g., 'retrying (1/3)') so users know progress
  • Custom PortInUseError: Creates descriptive error with actionable guidance after max retries
  • Graceful CLI handling: Catches PortInUseError specifically, logs it nicely, and exits gracefully without sending to Sentry
  • Preserves existing behavior: Electron and other error types continue to work as before

Changes

  • Added PortInUseError class in main.ts with helpful error message
  • Updated retry logging to show attempt progress
  • Added error handling in CLI server handler for graceful exit

Fixes SPOTLIGHT-7Q
Fixes SPOTLIGHT-8C
Fixes SPOTLIGHT-9A

Improve user experience when port 8969 is already in use:

- Add retry attempt tracking in log messages (e.g., 'retrying (1/3)')
- Create PortInUseError class with actionable error message
- Handle PortInUseError gracefully in CLI with clear error output
- Prevent PortInUseError from being sent to Sentry in CLI context

Fixes SPOTLIGHT-7Q/8C/9A
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
spotlightjs Skipped Skipped Jan 8, 2026 1:33am

@BYK BYK deployed to Preview January 8, 2026 00:48 — with GitHub Actions Active
@BYK BYK requested a review from betegon January 8, 2026 00:48
@BYK BYK marked this pull request as ready for review January 8, 2026 00:48
- Fix retry log order: check retries > MAX_RETRIES before logging to avoid showing (4/3)
- Add PortInUseError handling to tail command handler
- Fix linting: use single template literal instead of string concatenation
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.

3 participants