Skip to content

Conversation

@brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Dec 5, 2025

Improving error messaging for source file loading to help diagnose #664. This PR also changes the service error wrapper (sew) to return a generic error message for unexpected exceptions (i.e., any exception other than a explicitly thrown ServiceErrorException) to avoid leaking any potential sensitive information to the client.

Summary by CodeRabbit

  • Bug Fixes
    • Error messages now clearly distinguish between file source and repository information loading failures, providing more precise feedback to help identify what went wrong when browsing code content.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 5, 2025

Walkthrough

The pull request updates the CHANGELOG with an entry about improved error messages in the file source API and refactors error handling in the CodePreviewPanel component to provide distinct error messages for separate service failures instead of a single generic error.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Added "Updated" section entry describing improved error messages in the file source API
Component Error Handling
packages/web/src/app/[domain]/browse/[...path]/components/codePreviewPanel.tsx
Separated error checks for fileSourceResponse and repoInfoResponse to return specific error messages ("Error loading file source: {message}" or "Error loading repo info: {message}") instead of a single combined generic error check

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify that both service error paths are correctly separated and neither check is accidentally omitted
  • Confirm error message formatting is consistent and provides sufficient context for debugging

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: improving error messages for file loading errors, which aligns with the actual changes made to error handling in codePreviewPanel.tsx and the CHANGELOG update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bkellam/improved-file-loading-error-messages

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

This comment has been minimized.

@brendan-kellam
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Dec 5, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
CHANGELOG.md (1)

16-18: Align Unreleased section with Keep a Changelog conventions and fix capitalization

To stay consistent with the rest of this file and the Keep a Changelog categories, consider using ### Changed instead of ### Updated, and capitalize “API”:

-### Updated
-- Improved error messages in file source api. [#665](https://github.com/sourcebot-dev/sourcebot/pull/665)
+### Changed
+- Improved error messages in file source API. [#665](https://github.com/sourcebot-dev/sourcebot/pull/665)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d85a05 and efecb62.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • packages/web/src/app/[domain]/browse/[...path]/components/codePreviewPanel.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/web/src/app/[domain]/browse/[...path]/components/codePreviewPanel.tsx (2)
packages/web/src/lib/utils.ts (1)
  • isServiceError (430-436)
packages/mcp/src/utils.ts (1)
  • isServiceError (4-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

@brendan-kellam brendan-kellam merged commit d63f3cf into main Dec 5, 2025
9 checks passed
@brendan-kellam brendan-kellam deleted the bkellam/improved-file-loading-error-messages branch December 5, 2025 19:58
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.

2 participants