You need the main thread to notice the error and do something about it (like throw its own exception). Using `CompletableFuture`s (no couroutines) it would look something like:
fun test() {
doSomething().get() // get will throw if the future completed exceptionally
}