Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private inline fun runSafely(completion: Continuation<*>, block: () -> Unit) {
try {
block()
} catch (e: Throwable) {
completion.resumeWith(Result.failure(e))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment