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

Implement handleException method in SentryGenericDataFetcherExceptionHandler #3017

Closed
jrogers opened this issue Oct 30, 2023 · 5 comments · Fixed by #3090
Closed

Implement handleException method in SentryGenericDataFetcherExceptionHandler #3017

jrogers opened this issue Oct 30, 2023 · 5 comments · Fixed by #3090
Assignees
Labels
Platform: Java Type: Bug Something isn't working

Comments

@jrogers
Copy link

jrogers commented Oct 30, 2023

Integration

sentry

Java Version

17

Version

6.3.2

Steps to Reproduce

With graphql-java 21.2 (which is version now used in DGS 8), the deprecated method onException was removed from the DataFetcherExceptionHandler interface. In order to be compatible, my suggestion is that sentry-graphql implements the handleException method in SentryGenericDataFetcherExceptionHandler as well as onException to be compatible.

Expected Result

Exception handler works as intended with latest graphql-java

Actual Result

Execution java.lang.AbstractMethodError: Receiver class io.sentry.graphql.SentryGenericDataFetcherExceptionHandler does not define or inherit an implementation of the resolved method 'abstract java.util.concurrent.CompletableFuture handleException(graphql.execution.DataFetcherExceptionHandlerParameters)' of interface graphql.execution.DataFetcherExceptionHandler.

@jrogers jrogers added Platform: Java Type: Bug Something isn't working labels Oct 30, 2023
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Oct 30, 2023
@adinauer
Copy link
Member

adinauer commented Nov 2, 2023

Thanks for opening this issue @jrogers we'll improve compatibility - can't give an ETA at this point.
As a workaround, can you copy the code in SentryGenericDataFetcherExceptionHandler into a new class where you implement the now required method, so you're not blocked? Then register that as a @Bean.

@adinauer
Copy link
Member

adinauer commented Nov 6, 2023

Sorry the deleted messages were intended for another issue.

@lbloder lbloder self-assigned this Nov 7, 2023
@jrogers
Copy link
Author

jrogers commented Nov 13, 2023

Thanks for opening this issue @jrogers we'll improve compatibility - can't give an ETA at this point. As a workaround, can you copy the code in SentryGenericDataFetcherExceptionHandler into a new class where you implement the now required method, so you're not blocked? Then register that as a @Bean.

This actually won't work if you use a delegate exeception handler, because the onException was removed from the interface entirely and SentryGraphqlExceptionHandler will fail when it calls onException on the delegate with NoSuchMethodError

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 Nov 13, 2023
@jrogers
Copy link
Author

jrogers commented Nov 14, 2023

I just ended up forking both SentryGenericDataFetcherExceptionHandler and SentryGraphqlExceptionHandler for now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Java Type: Bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants