File tree Expand file tree Collapse file tree
sdk-api-kotlin/src/main/kotlin/dev/restate/sdk/kotlin/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import dev.restate.serde.SerdeFactory
1818import dev.restate.serde.kotlinx.KotlinSerializationSerdeFactory
1919import dev.restate.serde.kotlinx.KotlinSerializationSerdeFactory.KtTypeTag
2020import dev.restate.serde.provider.DefaultSerdeFactoryProvider
21+ import java.lang.reflect.InvocationTargetException
2122import java.lang.reflect.Modifier
2223import java.util.*
2324import kotlin.reflect.KClass
@@ -231,10 +232,14 @@ internal class ReflectionServiceDefinitionFactory : ServiceDefinitionFactory<Any
231232 serdeFactory,
232233 overrideHandlerOptions ? : dev.restate.sdk.kotlin.HandlerRunner .Options .DEFAULT ,
233234 ) { _, input ->
234- if (parameterCount == 0 ) {
235- kFunction.callSuspend(serviceInstance)
236- } else {
237- kFunction.callSuspend(serviceInstance, input)
235+ try {
236+ if (parameterCount == 0 ) {
237+ kFunction.callSuspend(serviceInstance)
238+ } else {
239+ kFunction.callSuspend(serviceInstance, input)
240+ }
241+ } catch (t: InvocationTargetException ) {
242+ throw t.cause!!
238243 }
239244 }
240245 }
You can’t perform that action at this time.
0 commit comments