Skip to content
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

Raised Exceptions are too generic, could we have a more specific one? #93

Closed
stabacco opened this issue May 25, 2020 · 4 comments
Closed
Labels
type: question or discussion Issue discussing or asking a question about gql

Comments

@stabacco
Copy link

There are a few places (example) where simple Exception s are being raised.
Would it be possible to change those for some more specialized exceptions? Otherwise they are a bit difficult to catch and they could end up masking other errors.

Thanks.

@leszekhanusz
Copy link
Collaborator

In fact this specific check and exception could be removed and replaced by an annotation.

If the check is removed, then an exception of type TypeError should be generated from
graphql/language/source.py#L29 (not tested)

I'll make a PR later.

@leszekhanusz
Copy link
Collaborator

I checked where are the other generic exception raised.

client.py#L75 Could be replaced by an assertion
dsl.py#L127 Could be replaced by a TypeError
scripts/gql-cli#L30 Could be replaced by a ValueError

@leszekhanusz
Copy link
Collaborator

Now Implemented in PR #95

@KingDarBoja
Copy link
Contributor

Closing as resolved by #95.

@KingDarBoja KingDarBoja added the type: question or discussion Issue discussing or asking a question about gql label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about gql
Projects
None yet
Development

No branches or pull requests

3 participants