Skip to content

Commit d45f7c4

Browse files
author
Stephane Maldini
committed
Use explicit onErrorMap(class.java) instead of reactor kotlin extension
1 parent 85cecb6 commit d45f7c4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

spring-core-coroutines/src/main/kotlin/org/springframework/core/CoroutinesUtils.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import kotlinx.coroutines.reactive.flow.asPublisher
2828

2929
import kotlinx.coroutines.reactor.mono
3030
import reactor.core.publisher.Mono
31-
import reactor.core.publisher.onErrorMap
3231
import java.lang.reflect.InvocationTargetException
3332
import java.lang.reflect.Method
3433
import kotlin.reflect.full.callSuspend
@@ -67,7 +66,7 @@ internal fun invokeHandlerMethod(method: Method, bean: Any, vararg args: Any?):
6766
val mono = GlobalScope.mono(Dispatchers.Unconfined) {
6867
function.callSuspend(bean, *args.sliceArray(0..(args.size-2)))
6968
.let { if (it == Unit) null else it }
70-
}.onErrorMap(InvocationTargetException::class) { it.targetException }
69+
}.onErrorMap(InvocationTargetException::class.java) { it.targetException }
7170
if (function.returnType.classifier == Flow::class) {
7271
mono.flatMapMany { (it as Flow<Any>).asPublisher() }
7372
}

0 commit comments

Comments
 (0)