io.johnsonlee.playground.util.ResultExtension.kt Maven / Gradle / Ivy
The newest version!
@file:JvmName("ResultUtils")
package io.johnsonlee.playground.util
import com.android.ide.common.rendering.api.Result
fun Result.check(): Result = apply {
if (!isSuccess) {
throw exception ?: Exception(errorMessage ?: status.toString())
}
}