Fixed - UndeclaredThrowableException is thrown when cache down while executing RLiveObjectService.get() method #3697

pull/3715/head
Nikita Koksharov 4 years ago
parent 42e9290ced
commit 548b4e4898

@ -28,6 +28,7 @@ import org.redisson.command.CommandBatchService;
import org.redisson.liveobject.misc.ClassUtils;
import org.redisson.liveobject.resolver.NamingScheme;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
@ -80,7 +81,7 @@ public class LiveObjectInterceptor {
@FieldValue("liveObjectLiveMap") RMap<String, ?> map,
@FieldProxy("liveObjectLiveMap") Setter mapSetter,
@FieldProxy("liveObjectLiveMap") Getter mapGetter
) throws Exception {
) throws Throwable {
if ("setLiveObjectId".equals(method.getName())) {
if (args[0].getClass().isArray()) {
throw new UnsupportedOperationException("RId value cannot be an array.");
@ -130,7 +131,11 @@ public class LiveObjectInterceptor {
return deleteFuture.getNow() > 0;
}
return method.invoke(map, args);
try {
return method.invoke(map, args);
} catch (InvocationTargetException e) {
throw e.getCause();
}
}

@ -15,6 +15,7 @@
*/
package org.redisson.liveobject.core;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.redisson.api.RMap;
@ -35,7 +36,11 @@ public class RMapInterceptor {
@Origin Method method,
@AllArguments Object[] args,
@FieldValue("liveObjectLiveMap") RMap<?, ?> map
) throws Exception {
return method.invoke(map, args);
) throws Throwable {
try {
return method.invoke(map, args);
} catch (InvocationTargetException e) {
throw e.getCause();
}
}
}

Loading…
Cancel
Save