apollo-client icon indicating copy to clipboard operation
apollo-client copied to clipboard

Fix for ServerError obscured by ServerParseError

Open dillontiner opened this issue 3 years ago • 1 comments
trafficstars

Fixes #8945 where not handling the response status code before parsing the response body text causes the apollo client to send a ServerParseError when it should send a ServerError.

The changes here are taken from #8974 which has been inactive for months

dillontiner avatar Aug 08 '22 22:08 dillontiner

@dillontiner: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

apollo-cla avatar Aug 08 '22 22:08 apollo-cla

@dillontiner Thanks for follow up on this and our apologies for the lingering PR review, we'll check this out soon. 🙏

jpvajda avatar Sep 01 '22 14:09 jpvajda

This seems to be failing the NPM Bundle Size check

jpvajda avatar Sep 01 '22 18:09 jpvajda

LGTM. I went ahead and added some extra tests - we're now testing unparsable JSON with both 200 and 400 server response codes. Other than that, I'm glad to get this merged! Thanks a ton @TakahiroHimi for the original PR and @dillontiner for keeping the fix alive.

All the best, Emmanuel, Intern :-)

MrDoomBringer avatar Sep 22 '22 17:09 MrDoomBringer