diff --git a/rxhttp/src/main/java/rxhttp/AwaitTransform.kt b/rxhttp/src/main/java/rxhttp/AwaitTransform.kt index 12319bcd..7826241c 100644 --- a/rxhttp/src/main/java/rxhttp/AwaitTransform.kt +++ b/rxhttp/src/main/java/rxhttp/AwaitTransform.kt @@ -414,7 +414,7 @@ suspend fun Deferred.awaitResult(onSuccess: (value: T) -> Unit): Result Deferred.tryAwait(onCatch: ((Throwable) -> Unit)?): T? = +suspend fun Deferred.tryAwait(onCatch: ((Throwable) -> Unit)? = null): T? = try { await() } catch (e: Throwable) { @@ -423,7 +423,7 @@ suspend fun Deferred.tryAwait(onCatch: ((Throwable) -> Unit)?): T? = } //return null when an error occurs. -suspend fun Await.tryAwait(onCatch: ((Throwable) -> Unit)?): T? = +suspend fun Await.tryAwait(onCatch: ((Throwable) -> Unit)? = null): T? = try { await() } catch (e: Throwable) {