api / org.gradle.api.tasks.testing / TestResult / getException

getException

abstract fun getException(): Throwable

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.