commit | 1de51a1bdff5748d7719c586b17801c58fe4ca0e | [log] [tgz] |
---|---|---|
author | Chalard Jean <jchalard@google.com> | Thu Nov 25 11:14:32 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Nov 25 11:14:32 2021 +0000 |
tree | c7f363c93c874adf0841ec70b9d2f0636fdeb98d | |
parent | e5a07502eafe210612a14ae29b12a8d382e93849 [diff] | |
parent | 28348e43aee99b159746d0e28e1814d25d25bffc [diff] |
Have tryTest{} work with throwables am: c4e700607d Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1901338 Change-Id: Ib556a0f1f0618217bec4551bd1dbea3f9c1d87f6
diff --git a/staticlibs/testutils/hostdevice/com/android/testutils/Cleanup.kt b/staticlibs/testutils/hostdevice/com/android/testutils/Cleanup.kt index 22b9b6c..eec8128 100644 --- a/staticlibs/testutils/hostdevice/com/android/testutils/Cleanup.kt +++ b/staticlibs/testutils/hostdevice/com/android/testutils/Cleanup.kt
@@ -84,7 +84,7 @@ inline infix fun cleanup(block: () -> Unit): T { try { block() - } catch (e: Exception) { + } catch (e: Throwable) { val originalException = result.exceptionOrNull() if (null == originalException) { throw e @@ -101,7 +101,7 @@ fun <T> tryTest(block: () -> T) = TryExpr( try { Result.success(block()) - } catch (e: Exception) { + } catch (e: Throwable) { Result.failure(e) })