Skip to content

Could you make ProvideError public? #1165

Open
@lamba92

Description

@lamba92

What feature would you like to see?

protected interface ProvideError {
  Exception getError();
}

This interface public

How would you use it?

Allowing it to be public, you could then create Kotlin extension on the highest generic upper bound of StorageTask like:

fun Continuation<Unit>.resume(): Unit =
    resumeWith(Result.success(Unit))

suspend fun <T : StorageTask.ProvideError> StorageTask<T>.await() = suspendCancellableCoroutine<Unit> { cont ->
    val l = OnCompleteListener<T> { cont.resume() }
    addOnCompleteListener(l)
    cont.invokeOnCancellation { removeOnCompleteListener(l) }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions