Skip to content

add logging to partial processing on .md urls#2778

Open
atharvadeosthale wants to merge 1 commit intomainfrom
add-logging
Open

add logging to partial processing on .md urls#2778
atharvadeosthale wants to merge 1 commit intomainfrom
add-logging

Conversation

@atharvadeosthale
Copy link
Member

@atharvadeosthale atharvadeosthale commented Mar 2, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved error logging for partial loading failures, providing better visibility when issues occur during content loading.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

Walkthrough

A catch block in the Markdown partial loader now captures errors and logs them to the console using console.error(), whereas previously it was empty. The subsequent behavior—logging a warning and caching an empty string—remains unchanged. This modification adds error visibility during partial load failures without altering core functionality.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add logging to partial processing on .md urls' directly and accurately describes the main change: adding error logging to the Markdown partial loader's catch block.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-logging

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.

Copy link
Contributor

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/server/markdown.ts`:
- Around line 39-40: In the catch block that logs loading partial errors (the
catch (error) handler that calls console.error('An error occured while loading
partial', error)), correct the typo in the log message by changing "occured" to
"occurred" so the console.error call reads "An error occurred while loading
partial" while preserving the error object argument.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6c37c17 and a2eb3a4.

📒 Files selected for processing (1)
  • src/lib/server/markdown.ts

Comment on lines +39 to +40
} catch (error) {
console.error('An error occured while loading partial', error);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix typo in the error log message.

Line 40 has a typo (occuredoccurred), which makes diagnostics look less polished.

Proposed fix
-                console.error('An error occured while loading partial', error);
+                console.error('An error occurred while loading partial', error);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} catch (error) {
console.error('An error occured while loading partial', error);
} catch (error) {
console.error('An error occurred while loading partial', error);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/server/markdown.ts` around lines 39 - 40, In the catch block that
logs loading partial errors (the catch (error) handler that calls
console.error('An error occured while loading partial', error)), correct the
typo in the log message by changing "occured" to "occurred" so the console.error
call reads "An error occurred while loading partial" while preserving the error
object argument.

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