Repository navigation
fix(XmlPreview): improve XML parsing error handling and return structure - #8860
vijayh-bruno merged 13 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
ChangesXML preview handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
da36e14 to
0158253
Compare
helloanoop
left a comment
There was a problem hiding this comment.
Left a few comments @abhishekp-bruno
ff54068 to
86d572c
Compare
e5cec66 to
885c39d
Compare
5b8818d to
a7dee2f
Compare
…e for XML parsing
…ions for error handling
…gic for XML input
…aming for clarity
…error object for invalid XML
Broader XML preview coverage moves to test/xml-preview-extra-coverage. Co-Authored-By: Claude Fable 5 <[email protected]>
…unnecessary comments
5249e91 to
658ef56
Compare
Internal - [BRU-3061]
Fixes: #7735
Description
The XML preview pane renders a "Cannot preview as XML" banner for valid XML whose root element is
<error>, e.g.:Any API that returns an error envelope in this shape (which is common) can't be previewed as XML at all, even though the response parses perfectly fine.
Problem
The
useMemoreturned an untagged object that overloaded theerrorkey for two different meanings:{ error: 'Failed to parse XML string...' }The subsequent check was
parsedData.error, which can't distinguish "the parse failed" from "the parse succeeded and the root node happens to be namederror". Failure and success share the same key space, so the collision is unavoidable by inspection.Screenshots
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
Bug Fixes
errorroot element.Tests