Skip to content

[Question] Is there any documentation about error handling? #204

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

Closed
felinto-dev opened this issue May 5, 2021 · 1 comment · Fixed by #266
Closed

[Question] Is there any documentation about error handling? #204

felinto-dev opened this issue May 5, 2021 · 1 comment · Fixed by #266
Labels
type: documentation An issue or pull request for improving or updating the documentation

Comments

@felinto-dev
Copy link

felinto-dev commented May 5, 2021

Hello!

Is there any documentation about error handling?

        try:
            client.execute(query, variable_values=params)
        except:
            pass

I want to catch the error of when the GraphQL endpoint returns the error code 400 - 403, and NOT an error related to the incorrect schema, for example.

I would know what NameError I should assign to except block to be able to print error messages in a friendly way to the user.

@leszekhanusz
Copy link
Collaborator

leszekhanusz commented May 22, 2021

This is not really documented except maybe in the source code
You can check this comment explaining the situation.

A 40x error should normally generate a TransportServerError but only if we did not receive a valid GraphQL response and will in the next release put the http code in the TransportServerError exception.

@leszekhanusz leszekhanusz added the type: documentation An issue or pull request for improving or updating the documentation label May 22, 2021
@leszekhanusz leszekhanusz linked a pull request Nov 27, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation An issue or pull request for improving or updating the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants