For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

getException

@Nullable
abstract fun getException(): @Nullable Throwable(source)

If the test failed with an exception, this will be the exception. Some test frameworks do not fail without an exception (JUnit), so in those cases this method will never return null.

Return

The exception, if any, logged for this test. If none, a null is returned.

Since

0.9