fix(rpc-triple): Fix missing error code (#13379)

This commit is contained in:
Sean Yang 2023-11-20 12:56:31 +08:00 committed by GitHub
parent 7a44bb8ba1
commit 633bdbd08f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -801,6 +801,9 @@ public class ApplicationConfig extends AbstractConfig {
if (StringUtils.isEmpty(getName())) {
this.setName(DEFAULT_APP_NAME);
LOGGER.warn(
COMMON_UNEXPECTED_EXCEPTION,
"",
"",
"No application name was set, '" + DEFAULT_APP_NAME
+ "' will be used as the default application name,"
+ " it's highly recommended to set a unique and customized name for it can be critical for some service governance features.");

View File

@ -63,6 +63,7 @@ import java.util.concurrent.Executor;
import java.util.function.Supplier;
import static org.apache.dubbo.common.constants.CommonConstants.HEADER_FILTER_KEY;
import static org.apache.dubbo.common.constants.LoggerCodeConstants.COMMON_ERROR_USE_THREAD_POOL;
import static org.apache.dubbo.common.constants.LoggerCodeConstants.INTERNAL_ERROR;
import static org.apache.dubbo.common.constants.LoggerCodeConstants.PROTOCOL_FAILED_PARSE;
@ -122,12 +123,12 @@ public abstract class AbstractServerTransportListener<HEADER extends RequestMeta
try {
this.executor = initializeExecutor(metadata);
} catch (Throwable throwable) {
LOGGER.error("initialize executor fail.", throwable);
LOGGER.error(COMMON_ERROR_USE_THREAD_POOL, "", "", "initialize executor fail.", throwable);
onError(throwable);
return;
}
if (this.executor == null) {
LOGGER.error("executor must be not null.");
LOGGER.error(INTERNAL_ERROR, "", "", "executor must be not null.");
onError(new NullPointerException("initializeExecutor return null"));
return;
}
@ -135,7 +136,7 @@ public abstract class AbstractServerTransportListener<HEADER extends RequestMeta
try {
doOnMetadata(metadata);
} catch (Throwable throwable) {
LOGGER.error("server internal error", throwable);
LOGGER.error(INTERNAL_ERROR, "", "", "server internal error", throwable);
onError(throwable);
}
});
@ -182,7 +183,7 @@ public abstract class AbstractServerTransportListener<HEADER extends RequestMeta
try {
doOnData(message);
} catch (Throwable e) {
LOGGER.error("server internal error", e);
LOGGER.error(INTERNAL_ERROR, "", "", "server internal error", e);
onError(e);
}
});