|
|
@@ -125,9 +125,9 @@ func ParseResponse(input any) (*Response, error) {
|
|
|
|
|
|
// 情况 4:错误时的应答 → 必须有id&且不能空
|
|
|
if resp.Error != nil && resp.Error.Code == ErrParse { // 当发生解析错误时, "id"必须为: nil
|
|
|
- if resp.ID != nil {
|
|
|
+ /*if resp.ID != nil { // 虽然更符合规范, 但老版本请求有的会返回ErrParse, 为了兼容, 暂不启用
|
|
|
return nil, errors.New(`"id" must be null for parse error`)
|
|
|
- }
|
|
|
+ }*/
|
|
|
return &resp, nil
|
|
|
}
|
|
|
|
|
|
@@ -240,9 +240,9 @@ func BuildError(req *Request, code ErrCode, message string) *Response {
|
|
|
id = req.ID
|
|
|
}
|
|
|
|
|
|
- if code == ErrParse {
|
|
|
+ /*if code == ErrParse {
|
|
|
id = nil
|
|
|
- }
|
|
|
+ }*/ // 虽然更符合规范, 但老版本请求有的会返回ErrParse, 为了兼容, 暂不启用
|
|
|
|
|
|
emsg := message
|
|
|
if emsg == "" {
|