Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stringifying xhr error response #2804

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

boazblake
Copy link
Contributor

When an XHR error response is returned with responseType set to 'json' the error reponse is not handled correctly.

Description

When the responseText is type JSON the response is still assigned to the new Error which is expecting a string.

Motivation and Context

This PR is an attempt to address #2802

How Has This Been Tested?

I ran yarn test request/tests/test-request.js
I saw a bunch of warnings and errors that were unrelated I believe.

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation change

Checklist:

  • [ x] My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • [ x] I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • [x ] All new and existing tests passed.
  • I have updated docs/changelog.md

@project-bot project-bot bot added this to Needs triage in Triage/bugs Sep 18, 2022
Bumps [terser](https://github.com/terser/terser) from 4.3.4 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
@dead-claudia
Copy link
Member

Not accepting this unless you can figure out a way to do it for xhr.responseType === "arraybuffer" and similar. I'm not special-casing "json" without confirmation that's the only one affected.

Copy link
Member

@dead-claudia dead-claudia left a comment

Choose a reason for hiding this comment

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

See comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Triage/bugs
Needs triage
Development

Successfully merging this pull request may close these issues.

None yet

3 participants