fix(objectnode): return error message when encountering internal err

close:#22997834

Signed-off-by: chihe <chihe@oppo.com>
This commit is contained in:
chihe 2025-01-22 16:42:59 +08:00 committed by zhumingze1108
parent c65d6c19df
commit b0807770c3

View File

@ -203,7 +203,11 @@ func (c *MasterClient) serveRequest(r *request) (repsData []byte, err error) {
}
if body.Code != proto.ErrCodeSuccess {
log.LogWarnf("serveRequest: code[%v], msg[%v], data[%v] ", body.Code, body.Msg, body.Data)
return []byte(body.Data), errors.New(body.Msg)
if body.Code == proto.ErrCodeInternalError && len(body.Msg) != 0 {
return nil, errors.New(body.Msg)
} else {
return nil, proto.ParseErrorCode(body.Code)
}
}
return body.Bytes(), nil
default: