[PR #3567] [MERGED] fix: XML body disappearing with invalid XML #4432

Closed
opened 2026-03-17 01:58:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3567
Author: @amk-dev
Created: 11/19/2023
Status: Merged
Merged: 11/20/2023
Merged by: @AndrewBastin

Base: release/2023.12.0Head: fix/xml-formatting-errors


📝 Commits (1)

  • 1fc5ad3 fix: catch xmlformatter errors

📊 Changes

1 file changed (+21 additions, -7 deletions)

View changed files

📝 packages/hoppscotch-common/src/composables/codemirror.ts (+21 -7)

📄 Description

Fixes HFE-213
Closes #3236

Before

When formatting/parsing XML files, if the xml is invalid, request body disappeares. We were not catching the error thrown by the XMLFormatter function.

After

We capture and handle the thrown error with a try-catch. Also wrapped the try catch in a utility function that returns an Either to make it a little bit tidy.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3567 **Author:** [@amk-dev](https://github.com/amk-dev) **Created:** 11/19/2023 **Status:** ✅ Merged **Merged:** 11/20/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.12.0` ← **Head:** `fix/xml-formatting-errors` --- ### 📝 Commits (1) - [`1fc5ad3`](https://github.com/hoppscotch/hoppscotch/commit/1fc5ad38d8632c0cb4d4d5d9c5b1d0aaeb1a4a17) fix: catch xmlformatter errors ### 📊 Changes **1 file changed** (+21 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/composables/codemirror.ts` (+21 -7) </details> ### 📄 Description Fixes HFE-213 Closes #3236 **Before** When formatting/parsing XML files, if the xml is invalid, request body disappeares. We were not catching the error thrown by the XMLFormatter function. **After** We capture and handle the thrown error with a try-catch. Also wrapped the try catch in a utility function that returns an Either to make it a little bit tidy. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:58:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4432
No description provided.