Closed rrifafauzikomara closed 1 year ago
You should be able to unwrap the exception, but this looks tricky and a smell from an app developer's point of view.
I will work on it to improve this use case, thanks to report it
Hello, I'm finding it confusing why OperationException class the graphqlErrors list is empty
I'm testing to throw exception on purpose (for examle "mobile" I change it to "mobil")
error: OperationException(linkException: ServerException(originalException: null, parsedResponse: Response(data: null, errors: [GraphQLError(message: Variable "$mobile" is not defined by operation "SignIn"., locations: [ErrorLocation(line: 3, column: 18), ErrorLocation(line: 1, column: 1)], path: null, extensions: {category: graphql}), GraphQLError(message: Variable "$mobil" is never used in operation "SignIn"., locations: [ErrorLocation(line: 1, column: 17)], path: null, extensions: {category: graphql})], context: Context({ResponseExtensions: Instance of 'ResponseExtensions'}), response {errors: [{message: Variable "$mobile" is not defined by operation "SignIn"., extensions: {category: graphql}, locations: [{line: 3, column: 18}, {line: 1, column: 1}]}, {message: Variable "$mobil" is never used in operation "SignIn"., extensions: {category: graphql}, locations: [{line: 1, column: 17}]}]})), graphqlErrors: [])
But on GraphQL website the list of errors
is not empty
looks like it is not a graphql error, and also you can not expect to have the same result inside the playground, try with curl!
In addition, these kind of error are some things that we want to improve and throw a generic error, with the possibility to look inside each single one
closing this in favor of this https://github.com/zino-hofmann/graphql-flutter/issues/1270
We can just improve the error handling
Hi, I have a question about how to get real error message.
I have print the error by default like below.
And this is the result for above code.
As you can see above, the error is nested. But the point of error is
Token has expired
.My question is how to print the
Token has expired
message only?And also how to get status code of every error? As you can see above no status code printed.