SN-2683 已核对来源,附原文与上下文。
这在 SVN rev 147 里。
This is in SVN rev 147.
这样更标准。虽然 json-rpc 1.0 没有规定错误对象的格式,但它规定了错误务必是对象而不是字符串或其他值,因此我们得改过来才算正确。code/message 成员在后来的 json-rpc 规范里已经成为标准。
This is more standard, and although json-rpc 1.0 didn't specify the format of error objects, it did specify that they would be objects not strings or other values, so we needed to change this to be correct. The code/message members have become standard in later json-rpc specs.
如果你有检查 error 并期望字符串的代码,你需要改它。出错时,error 成员现在是对象而不是字符串。
If you have code that checks the error and expects a string, you'll need to change it. When there is an error, the error member is now an object not a string.
SVN rev 147 里尚有:
Also in SVN rev 147: