zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 620 forks source link

HttpLinkParserException #1230

Closed phetdekde closed 2 years ago

phetdekde commented 2 years ago

I got this HttpLinkParserException from the _parseHttpResponse(), while I was trying to query a data from my endpoint. This happens when it returns an actual 4xx response (Not 200 response with error attached to it)

I tried putting a try catch block and, use the if(res.hasException) but it still throw me this error and freeze my whole app.

Expected behavior I was hoping to find a way to handle an error that returns an actual 4xx response.

HttpLinkParserException

image

My function

image
phetdekde commented 2 years ago

Sorry. It was my fault, because I have my breakpoint on uncaught exception.

image