caivega / ipfslib

Other
2 stars 1 forks source link

S3 - jt_sign,有些返回错误是复合错误格式,但有些不是 #174

Closed foreso-GitHub closed 3 years ago

foreso-GitHub commented 3 years ago

jt_sign,有些返回错误是复合错误格式,但有些不是。应该统一成复合错误格式。 版本:v0.5.3-dev-20210112-40e7b904af8f335b8d615af73fcb4e2a29eb8f98 TestCase:FCJT_sign_000020

复合错误格式:

{
    "jsonrpc": "2.0",
    "method": "jt_sign",
    "params": [
        {
            "from": "jBLfGHtcDYwQNgmcKJp1q6QqwzM4XB1QW5",
            "message": "0x1234567890abcde0"
        }
    ],
    "id": 1
}

{
    "error": {
        "count": 1,
        "description": "The compound error.",
        "information": "1 errors"
    },
    "id": 1,
    "jsonrpc": "2.0",
    "result": [
        {
            "error": {
                "description": "No matching entry found.",
                "information": "null from key",
                "message": {
                    "from": "jBLfGHtcDYwQNgmcKJp1q6QqwzM4XB1QW5",
                    "message": "0x1234567890abcde0"
                }
            },
            "status": 140,
            "type": "tecNO_ENTRY"
        }
    ],
    "status": 1000,
    "type": "tedCOMPOUND"
}

非复合错误格式:

{
    "jsonrpc": "2.0",
    "method": "jt_sign",
    "params": [
        {
            "from": "jHb9CJAWyB4jr91VRWn96DkukG4bwdtyTh",
            "secret": "错误的秘钥",
            "message": "0x1234567890abcde0"
        }
    ],
    "id": 1
}

{
    "error": {
        "description": "Can't add an already created account.",
        "information": "Unknown secret format"
    },
    "id": 1,
    "jsonrpc": "2.0",
    "status": -191,
    "type": "tefCREATED"
}
foreso-GitHub commented 3 years ago

在版本v0.5.3-dev-20210113-5aa567d27f68102434021e72cbd0bad2349ae99e中验证,已经修复。