-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use Better Error Codes For GraphQL Client Errors #2208
Comments
The scope of this issue seems a bit open. What do you think one should do here exactly?
This sort of thing. |
@arboleya I believe we just need to use more specific error codes. For instance, if we validate that the used {
message: 'error message here',
locations: [ { line: 2, column: 3 } ],
path: [ 'submit' ] // or ['submitAndAwait']
} Then we can use a more appropriate error code, like: throw new FuelError(
FuelError.CODES.TRANSACTION_FAILED,
graphQlResponse.errors[0].err.message)
); We do not need to treat messages, since we can use the same ones thrown by the client. Perhaps we should start using better error codes only for transaction submission failure. If we validate that the extracted |
Is this related to or the same as? |
Going to unassign myself from this for now. |
Closing this in favor of #2467 |
We need to improve the error codes used when a GraphQL query/mutation/subscription throws an error from the client. This should be done on:
1 - FuelGraphqlSubscriber
2 - Provider.createOperations
This involves analyzing the
errors
array returned from the graphQL response. An error entry looks similar to this:In this case, we can identify that the error was caused by the query
coinsToSpend
, and the error message isnot enough coins to fit the target
.When implementing this error handling, is essential to identify what was the path ( query/mutation/subscription ) and use a proper FuelError code
The text was updated successfully, but these errors were encountered: