Created
September 15, 2022 13:06
-
-
Save aleksandarzekovic/7990f92c25ff1bfe1072d7b939b713ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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