错误码描述

RPC 错误码

当一个RPC调用遇到错误时,返回的响应对象必须包含error错误结果字段,该字段有下列成员参数:

  • code: 使用数值表示该异常的错误类型,必须为整数。
  • message: 对该错误的简单描述字符串。
  • data: 包含关于错误附加信息的基本类型或结构化类型,该成员可选。

错误对象包含两类错误码,分别是JSON-RPC标准错误码和FISCO BCOS RPC错误码。

JSON-RPC标准错误码

标准错误码及其对应的含义如下:

codemessage含义
-32600INVALID_JSON_REQUEST发送无效的请求对象
-32601METHOD_NOT_FOUND该方法不存在或无效
-32602INVALID_PARAMS无效的方法参数
-32603INTERNAL ERROR内部调用错误
-32604PROCEDURE_IS_METHOD内部错误,请求未提供id字段
-32700JSON_PARSE_ERROR服务端接收到的json无法解析

FISCO BCOS RPC错误码

FISCO BCOS RPC接口错误码及其对应的含义如下:

codemessage含义
-40001GroupID does not existGroupID不存在
-40002Response json parse errorJSON RPC获取的json数据解析错误
-40003BlockHash does not exist区块哈希不存在
-40004BlockNumber does not exist区块高度不存在
-40005TransactionIndex is out of range交易索引越界
-40006Call needs a ‘from’ fieldcall接口需要提供from字段
-40007Only pbft consensus supports the view propertygetPbftView接口,只有pbft共识机制有view属性
-40008Invalid System ConfiggetSystemConfigByKey接口,查询无效的key
-40009Don’t send requests to this group,
the node doesn’t belong to the group
非群组内节点发起无效的请求
-400010RPC module initialization is incompleteRPC模块初始化尚未完成

交易回执状态

status(十进制/十六进制)message含义
0(0x0)None正常
1(0x1)Unknown未知异常
2(0x2)BadRLP无效RLP异常
3(0x3)InvalidFormat无效格式异常
4(0x4)OutOfGasIntrinsic部署的合约长度超过gas限制/调用合约接口参数超过gas限制
5(0x5)InvalidSignature无效的签名异常
6(0x6)InvalidNonce无效nonce异常
7(0x7)NotEnoughCashcash不足异常
8(0x8)OutOfGasBase调用合约的参数过长 (RC版本)
9(0x9)BlockGasLimitReachedGasLimit异常
10(0xa)BadInstruction错误指令异常
11(0xb)BadJumpDestination错误目的跳转异常
12(0xc)OutOfGas合约执行时gas不足 / 部署的合约长度超过最长上限
13(0xd)OutOfStack栈溢出异常
14(0xe)StackUnderflow栈下限溢位异常
15(0xf)NonceCheckFailnonce检测失败异常
16(0x10)BlockLimitCheckFailblocklimit检测失败异常
17(0x11)FilterCheckFailfilter检测失败异常
18(0x12)NoDeployPermission非法部署合约异常
19(0x13)NoCallPermission非法call合约异常
20(0x14)NoTxPermission非法交易异常
21(0x15)PrecompiledErrorprecompiled错误异常
22(0x16)RevertInstructionrevert指令异常
23(0x17)InvalidZeroSignatureFormat无效签名格式异常
24(0x18)AddressAlreadyUsed地址占用异常
25(0x19)PermissionDenied无权限异常
26(0x1a)CallAddressError被调用的合约地址不存在

Precompiled Service API 错误码

错误码消息内容备注
0success
-50000permission denied
-50001table name already exist
-50100table does not exist
-50101unknow function call
-50102address invalid
-51000table name and address already exist
-51001table name and address does not exist
-51100invalid node IDSDK错误码
-51101the last sealer cannot be removed
-51102the node is not reachableSDK错误码
-51103the node is not a group peerSDK错误码
-51104the node is already in the sealer listSDK错误码
-51105the node is already in the observer listSDK错误码
-51200contract name and version already existSDK错误码
-51201version string length exceeds the maximum limitSDK错误码
-51300invalid configuration entry
-51500contract name and version already exist
-51501condition parse error
-51502condition operation undefined