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

feat(fetch): better errors messages for body-mixin methods #1654

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

KhafraDev
Copy link
Member

@KhafraDev KhafraDev commented Sep 16, 2022

Fixes #1653

The error messages are closer to chrome/firefox now. I don't think they need to be super descriptive.
image
image

edit: I considered adding the error header (ie. Response.text) but it would be relatively annoying to add the message to .json() as it just calls .text(), or the message would be completely wrong.

@codecov-commenter
Copy link

Codecov Report

Base: 94.89% // Head: 94.97% // Increases project coverage by +0.07% 🎉

Coverage data is based on head (e4fe195) compared to base (dcd4e81).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1654      +/-   ##
==========================================
+ Coverage   94.89%   94.97%   +0.07%     
==========================================
  Files          53       39      -14     
  Lines        4803     2828    -1975     
==========================================
- Hits         4558     2686    -1872     
+ Misses        245      142     -103     
Impacted Files Coverage Δ
index.js 80.00% <0.00%> (-20.00%) ⬇️
lib/handler/RedirectHandler.js 83.54% <0.00%> (-11.40%) ⬇️
lib/core/util.js 88.60% <0.00%> (-9.50%) ⬇️
lib/api/readable.js 82.75% <0.00%> (-8.63%) ⬇️
lib/core/request.js 92.54% <0.00%> (-7.46%) ⬇️
lib/proxy-agent.js 87.67% <0.00%> (-5.48%) ⬇️
lib/mock/mock-utils.js 95.13% <0.00%> (-4.87%) ⬇️
lib/core/connect.js 98.27% <0.00%> (-1.73%) ⬇️
lib/client.js 96.98% <0.00%> (-0.66%) ⬇️
lib/fetch/body.js
... and 13 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit 674875a into nodejs:main Sep 16, 2022
@KhafraDev KhafraDev deleted the disturbed-error branch September 16, 2022 18:42
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
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.

Provide a hint how to solve a disturbed exception
4 participants