getException

@Nullable
abstract fun getException(): 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.