dgs-framework
dgs-framework copied to clipboard
bug: Exceptions thrown from dataFetchers are being thrown as `java.lang.reflect.UndeclaredThrowableException`.
Expected behavior
DataFetcherExceptionHandler#onException
handlerParameters Will contain the thrown exception.
Actual behavior
DataFetcherExceptionHandler#onException
handlerParameters contains java.lang.reflect.UndeclaredThrowableException
, it's cause is the right exception.
Steps to reproduce
- Create a simple query.
- Create a test class for it
- mocked class will throw a custom Exception (inherited from Exception)
- set a breakPoint
DataFetcherExceptionHandler#onException
, see that the exception isjava.lang.reflect.UndeclaredThrowableException
Note: DataFetcher does throw the right exception and declares about it.
Hi @maory, we will need a minimal test to reproduce the issue. We use this feature extensibly.
If you need an example, and a way to set some breakpoint, you can look at our MicrometerServletSmokeTest.
Hey @berngp, found out this issue https://github.com/graphql-java-kickstart/graphql-java-tools/issues/477 in graphql-java which might be relevant.
The test case can be the same.