mirror of
https://github.com/alibaba/DataX.git
synced 2025-05-02 07:21:48 +08:00
Optimize exception error messages
This commit is contained in:
parent
329f7b28cf
commit
4e6bbfa1ef
@ -188,15 +188,18 @@ public class SelectdbCopyIntoObserver {
|
|||||||
if(success){
|
if(success){
|
||||||
LOG.info("commit success cost {}ms, response is {}", System.currentTimeMillis() - start, loadResult);
|
LOG.info("commit success cost {}ms, response is {}", System.currentTimeMillis() - start, loadResult);
|
||||||
}else{
|
}else{
|
||||||
throw new SelectdbWriterException("commit fail",true);
|
LOG.error("commit error with status {}, reason {}, response {}", statusCode, reasonPhrase, loadResult);
|
||||||
|
String copyErrMsg = String.format("commit error, status: %d, reason: %s, response: %s, copySQL: %s",
|
||||||
|
statusCode, reasonPhrase, loadResult, copySQL);
|
||||||
|
throw new SelectdbWriterException(copyErrMsg,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean handleCommitResponse(String loadResult) throws IOException {
|
public boolean handleCommitResponse(String loadResult) throws IOException {
|
||||||
BaseResponse<CopyIntoResp> baseResponse = OBJECT_MAPPER.readValue(loadResult, new TypeReference<BaseResponse<CopyIntoResp>>(){});
|
BaseResponse baseResponse = OBJECT_MAPPER.readValue(loadResult, new TypeReference<BaseResponse>(){});
|
||||||
if(baseResponse.getCode() == SUCCESS){
|
if(baseResponse.getCode() == SUCCESS){
|
||||||
CopyIntoResp dataResp = baseResponse.getData();
|
CopyIntoResp dataResp = OBJECT_MAPPER.convertValue(baseResponse.getData(), CopyIntoResp.class);
|
||||||
if(FAIL.equals(dataResp.getDataCode())){
|
if(FAIL.equals(dataResp.getDataCode())){
|
||||||
LOG.error("copy into execute failed, reason:{}", loadResult);
|
LOG.error("copy into execute failed, reason:{}", loadResult);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user