mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(objectnode): return error message when encountering internal err
close:#22997834 Signed-off-by: chihe <chihe@oppo.com>
This commit is contained in:
parent
c65d6c19df
commit
b0807770c3
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user