fix(fetchers/session): fallible client build + typed SessionError (#29 #45)#63
Conversation
- #29: Fetcher::new and build_client now return Result<_, FetcherError> instead of .expect()-panicking when the reqwest/TLS client fails to build. The fallibility propagates through SessionManager::add_session / ensure_default and CrawlerEngine::new; the CLI reports the error and exits instead of panicking. - #45: SessionManager::fetch now returns a typed SessionError (NotFound / UnsupportedMethod / Network) instead of a flat String, so callers can distinguish an unrecoverable config error (wrong session name) from a transient network failure. The engine still forwards the message to the on_error hook. Updated session/client tests for the new Result-returning signatures. Closes #29 Closes #45 https://claude.ai/code/session_012RmdaovmNWZVAim4XxCWwn
|
Warning Review limit reached
More reviews will be available in 28 minutes and 23 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 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 |
Summary
Error-handling hardening for the fetch path (both Medium):
Fetcher::newpanicked on client build failure:build_clientended in.expect("Failed to build reqwest client"), so a TLS-backend init failure crashed the process.build_clientandFetcher::newnow returnResult<_, FetcherError>. The fallibility propagates throughSessionManager::add_session/ensure_defaultandCrawlerEngine::new; the CLI reports the error and exits cleanly.SessionManager::fetcherased the error type: it returnedResult<_, String>, conflating "session not found" (config bug, unrecoverable) with network failures. IntroducedSessionError { NotFound, UnsupportedMethod, Network }. Callers can now match on the variant; the engine still forwards the message toon_error.Test plan
spiders_sessionandfetchers_clienttests for theResult-returning signaturescargo test,clippy --all-targets -D warnings,fmt --checkgreenCrawlerEngine::newhas no in-tree callers, so the signature change is containedCloses #29
Closes #45
Generated by Claude Code