Skip to content

fix: preserve original error when formatting fails - #171

Merged
RomainLanz merged 1 commit into
14.xfrom
fix/preserve-original-error
Aug 28, 2026
Merged

fix: preserve original error when formatting fails#171
RomainLanz merged 1 commit into
14.xfrom
fix/preserve-original-error

Conversation

@RomainLanz

@RomainLanz RomainLanz commented Aug 28, 2026

Copy link
Copy Markdown
Member

Hey! 👋🏻

This PR adds a fallback that if prettyPrintError throws we fallback to using kernel.ui.logger.fatal.

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling when debug error formatting fails.
    • Errors are now logged through the fatal logger instead of being lost or interrupting error handling.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 06d1adb7-6088-4ece-8e6f-06ea516a29cc

📥 Commits

Reviewing files that changed from the base of the PR and between 407ddae and ced81a2.

📒 Files selected for processing (2)
  • src/exception_handler.ts
  • tests/exception_handler.spec.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The debug-mode exception handler now catches failures from prettyPrintError and logs the original error with kernel.ui.logger.fatal. A test verifies this fallback behavior.

Changes

Debug error fallback

Layer / File(s) Summary
Pretty-print fallback and validation
src/exception_handler.ts, tests/exception_handler.spec.ts
The debug rendering path logs the original error when prettyPrintError throws. The test captures the fatal log argument and checks that it matches the original error.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to ced81

The change preserves the original error if formatting fails and reports it through the existing fatal logger. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving the original error when error formatting fails.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/preserve-original-error

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/exception_handler.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

tests/exception_handler.spec.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).


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.

@RomainLanz RomainLanz closed this Aug 28, 2026
@RomainLanz RomainLanz reopened this Aug 28, 2026
@RomainLanz
RomainLanz force-pushed the fix/preserve-original-error branch from ced81a2 to 61f383e Compare August 28, 2026 14:09
@RomainLanz
RomainLanz merged commit 07bc1ed into 14.x Aug 28, 2026
11 checks passed
@RomainLanz
RomainLanz deleted the fix/preserve-original-error branch August 28, 2026 14:10
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