fix(web): surface actionable error when Lighthouse is unreachable#1293
Conversation
When a fetch to the Lighthouse licensing service throws at the network layer (DNS, TLS, connection refused, timeout), the raw error bubbled through sew and was flattened into a generic "an unexpected error occurred" message, giving self-hosted operators nothing to act on. Centralize the request in a requestLighthouse helper that catches the throw and returns a LIGHTHOUSE_UNREACHABLE ServiceError naming the URL and underlying cause. As a ServiceError it is preserved by sew instead of genericized, so the real failure reaches the user. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe PR adds dedicated error handling for unreachable Lighthouse licensing services. A new error code and factory function create actionable SERVICE_UNAVAILABLE errors with extracted failure details. The billing client is refactored to centralize HTTP request logic through reusable helpers, with all endpoints rewired to use the shared infrastructure instead of inlined per-endpoint patterns. ChangesLighthouse unreachable error handling
🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
When a
fetchto the Lighthouse licensing service throws at the network layer (DNS, TLS, connection refused, timeout), the raw error bubbled throughsewand was flattened into a generic "an unexpected error occurred" — leaving self-hosted operators with nothing to act on.This centralizes the call in a
requestLighthousehelper that catches the throw and returns aLIGHTHOUSE_UNREACHABLEServiceErrornaming the URL and underlying cause. Because it's now aServiceError,sewpreserves it instead of genericizing it, so the real failure reaches the user.🤖 Generated with Claude Code
Summary by CodeRabbit