Tag: 例外

Kotlin – exception后继续协程

我的问题 exception之后是否可以继续执行协程? 例 try { someMethod1() someMethod2() //Throws an exception! someMethod3() } catch(e: Exception) { //I do not want to call someMethod3 here! //I want the coroutine to resume after the exception inside of the original block. } finally { //I also do not want to call someMethod3 here! //I want the coroutine to resume […]

在这种情况下,神秘地转义try-catch块的例外最可能的原因是什么?

我在这样的Kotlin项目中使用Spring WebClient : data class DTO(val name: String) @Component class Runner: ApplicationRunner { override fun run(args: ApplicationArguments?) { try { val dto = get() } catch (e: Exception) { println(“ERROR, all exceptions should have been caught in ‘get’ “) } } } inline private fun get(): TResult? { var result: TResult? = null try { […]