You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gradle should not print InvocationTargetException since it is not really a user-facing exception. It is used by Java as a marker for the reflection-induced exceptions.
However, InvocationTargetException adds virtually zero extra information, and in 99.42% of the cases the right thing is to print the cause of InvocationTargetException.
Here's one of the cases when ignoring InvocationTargetException would make things easier to understand: #13862
The message would change from InvocationTargetException (no error message) to NoSuchMethodException: com.gradle.scan.plugin.internal.d.d.$deserializeLambda$(java.lang.invoke.SerializedLambda)
InvocationTargetException (no error message) would become AnnotationProcessingError: java.lang.NoClassDefFoundError: javax/annotation/Generated
and so on.
Current Behavior
Currently, Gradle might print the following message
* What went wrong:
Execution failed for task ':core-data:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
@mlopatkin, sorry for pinging you directly, however, I see you investigated #17462 earlier. WDYT if Gradle prints the cause instead of InvocationTargetException?
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.
This feature request is in the backlog of the relevant team, but this area of Gradle is currently not in focus. It might take a while before it gets implemented.
Expected Behavior
Gradle should not print
InvocationTargetException
since it is not really a user-facing exception. It is used by Java as a marker for the reflection-induced exceptions.However,
InvocationTargetException
adds virtually zero extra information, and in 99.42% of the cases the right thing is to print the cause ofInvocationTargetException
.Suggested behavior:
Here's one of the cases when ignoring
InvocationTargetException
would make things easier to understand: #13862The message would change from
InvocationTargetException (no error message)
toNoSuchMethodException: com.gradle.scan.plugin.internal.d.d.$deserializeLambda$(java.lang.invoke.SerializedLambda)
#17462
InvocationTargetException (no error message)
would becomeAnnotationProcessingError: java.lang.NoClassDefFoundError: javax/annotation/Generated
and so on.
Current Behavior
Currently, Gradle might print the following message
Sample code: https://github.com/JetBrains/kotlin/blob/12d31adbc49e0cbb588643aa962a716b043f26c2/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/kapt/KaptWithoutKotlincTask.kt#L285
The code calls
Method#invoke
, soInvocationTargetException
might be thrown as a result.Context
The text was updated successfully, but these errors were encountered: