[bugfix](Coordinator) The error msg hide host info exclude localhost (#24817)

Exception information is incomplete when localhost exists in the log.
This commit is contained in:
Guangdong Liu
2023-09-25 09:45:00 +08:00
committed by GitHub
parent 129ffb7dd7
commit ec93ea22b3

View File

@ -1247,7 +1247,10 @@ public class Coordinator implements CoordInterface {
String errMsg = copyStatus.getErrorMsg();
LOG.warn("query failed: {}", errMsg);
// hide host info
// hide host info exclude localhost
if (errMsg.contains("localhost")) {
throw new UserException(errMsg);
}
int hostIndex = errMsg.indexOf("host");
if (hostIndex != -1) {
errMsg = errMsg.substring(0, hostIndex);