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

InvocationTargetException masking GraphQLException in data fetcher #9

Open
hogancr opened this issue Feb 7, 2017 · 0 comments
Open

Comments

@hogancr
Copy link

hogancr commented Feb 7, 2017

Because of the wrapping that takes place in spring-graphql-common, the contents of any exceptions thrown by a data fetcher (specifically mine is an @ GraphQLMutation) is blown away by the InvocationTargetException.

I followed the advice here to try and hide the stack trace info because the stack traces are outrageously large. Now all I get is

{"errors":[{"type":"DataFetchingException","message":"Exception while fetching data: com.oembedler.moon.graphql.engine.ReflectionGraphQLDataMutator$DataMutatorRuntimeException: Exception while calling data fetcher [addStationToDashboard]; nested exception is java.lang.reflect.InvocationTargetException"}]}

...despite the fact my mutation method is throwing GraphQLException with a description that makes the reason for the error clear (it's a query input validation thing that can only be done here...basically checking for the existence of some key in a map).

Not sure how to get around this, but it would be nice to have something that at least prints the message from my GraphQLExcception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant