[improvement](jdbc catalog) optimize the JDBC Catalog connection error message (#23868)
This commit is contained in:
@ -162,8 +162,9 @@ public abstract class JdbcClient {
|
||||
try {
|
||||
conn = dataSource.getConnection();
|
||||
} catch (Exception e) {
|
||||
throw new JdbcClientException("Can not connect to jdbc due to error: %s, catalog name: %s", e.getMessage(),
|
||||
this.catalog, e);
|
||||
String errorMessage = String.format("Can not connect to jdbc due to error: %s, Catalog name: %s", e,
|
||||
this.getCatalog());
|
||||
throw new JdbcClientException(errorMessage, e);
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
@ -104,6 +104,7 @@ import org.apache.doris.common.util.ProfileManager.ProfileType;
|
||||
import org.apache.doris.common.util.SqlParserUtils;
|
||||
import org.apache.doris.common.util.TimeUtils;
|
||||
import org.apache.doris.common.util.Util;
|
||||
import org.apache.doris.datasource.jdbc.client.JdbcClientException;
|
||||
import org.apache.doris.load.EtlJobType;
|
||||
import org.apache.doris.load.LoadJobRowResult;
|
||||
import org.apache.doris.load.loadv2.LoadManager;
|
||||
@ -778,6 +779,10 @@ public class StmtExecutor {
|
||||
LOG.warn("execute Exception. {}", context.getQueryIdentifier(), e);
|
||||
context.getState().setError(e.getMysqlErrorCode(), e.getMessage());
|
||||
context.getState().setErrType(QueryState.ErrType.ANALYSIS_ERR);
|
||||
} catch (JdbcClientException e) {
|
||||
LOG.warn("execute Exception. {}", context.getQueryIdentifier(), e);
|
||||
context.getState().setError(ErrorCode.ERR_UNKNOWN_ERROR,
|
||||
e.getMessage());
|
||||
} catch (Exception e) {
|
||||
LOG.warn("execute Exception. {}", context.getQueryIdentifier(), e);
|
||||
context.getState().setError(ErrorCode.ERR_UNKNOWN_ERROR,
|
||||
|
||||
Reference in New Issue
Block a user