Add error code support of ListenerInvokerWrapper. (#11065)
This commit is contained in:
parent
3c68e9476e
commit
2f55e72ac9
|
|
@ -36,9 +36,9 @@ import static org.apache.dubbo.common.constants.LoggerCodeConstants.REGISTRY_ERR
|
|||
|
||||
public class KubernetesMeshEnvListener implements MeshEnvListener {
|
||||
public static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(KubernetesMeshEnvListener.class);
|
||||
private volatile static boolean usingApiServer = false;
|
||||
private volatile static KubernetesClient kubernetesClient;
|
||||
private volatile static String namespace;
|
||||
private static volatile boolean usingApiServer = false;
|
||||
private static volatile KubernetesClient kubernetesClient;
|
||||
private static volatile String namespace;
|
||||
|
||||
private final Map<String, MeshAppRuleListener> appRuleListenerMap = new ConcurrentHashMap<>();
|
||||
|
||||
|
|
@ -103,11 +103,11 @@ public class KubernetesMeshEnvListener implements MeshEnvListener {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(WatcherException cause) {
|
||||
// ignore
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onClose(WatcherException cause) {
|
||||
// ignore
|
||||
}
|
||||
});
|
||||
vsAppWatch.put(appName, watch);
|
||||
try {
|
||||
GenericKubernetesResource vsRule = kubernetesClient
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.dubbo.rpc.listener;
|
||||
|
||||
import org.apache.dubbo.common.URL;
|
||||
import org.apache.dubbo.common.constants.LoggerCodeConstants;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
import org.apache.dubbo.common.utils.CollectionUtils;
|
||||
|
|
@ -100,11 +101,12 @@ public class ListenerInvokerWrapper<T> implements Invoker<T> {
|
|||
try {
|
||||
consumer.accept(listener);
|
||||
} catch (RuntimeException t) {
|
||||
logger.error(t.getMessage(), t);
|
||||
logger.error(LoggerCodeConstants.INTERNAL_ERROR, "wrapped listener internal error", "", t.getMessage(), t);
|
||||
exception = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (exception != null) {
|
||||
throw exception;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue