错误码规范

希沃物联平台的错误码统一为6位数字的字符串,以1开头代表不同端,其中"000000"表示成功。

1 错误码范围

模块 错误码段
成功 000000
IoT管理服务 120000
IoT注册服务 130000
Broker 150000
规则引擎 160000
IoT设备SDK 170000
非IoT平台错误码 非0及1开头段,如200000

2 详细错误码

2.1 管理服务

类型 code message 中文
- 120100 request params illegal Request Params Illegal
- 120101 can not delete product 删除产品失败
- 120103 Function Key Already Exist 功能标识符已存在
- 120104 ProductKey Not Exist 产品标识不存在
- 120105 desired can not be empty 期望值不能为空
- 120106 Device Not Exist 设备不存在
- 120107 Product Name Already Exist 产品名称已存在
- 120108 http method error http method不支持
- 120109 device unActive 设备未激活
- 120110 device status error 设备状态异常
- 120111 all key not definition 所有下发属性未定义
- 120112 service key not definition service key未定义
- 120113 Device Name Already Exist 设备名称已存在
- 120114 Rule Already Exist 规则已存在
- 120115 Sign Validate sign fail 签名校验不通过
- 120116 Have Not Permission 无权限
- 120117 Have Not Time Condition 时间范围未指定
- 120118 Fetch Log Error 获取日志异常
- 120119 Exceeding Time Limit 查询时间过期
- 120120 device token validate fail 设备token无效
- 120121 user not exist 用户不存在
- 120122 Device Forbidden 设备已禁用
- 120123 reserved word should not be used 保留字不可使用
- 120124 device gateway not match 子设备网关不匹配
- 120125 device gateway not bind 子设备未绑定网关
- 120126 rule export error 规则导出异常
- 120127 function not exist 物模型功能不存在
- 120128 Post Log Error 日志上报异常
- 120119 Device Not on line 设备不在线
- 120130 tag not exist 标签不存在
- 120131 tag already exist 标签已存在
- 120132 tag illegal 标签不合法
- 120200 fail to insert 新增记录失败
- 120201 fail to update 更新记录失败
- 120202 fail to update 删除记录失败
- 120300 service side exception 服务调用异常
- 120301 get version exception 版本获取异常
- 120401 topic not exist topic不存在
- 120402 topic already exist topic已存在
- 120403 topic not support topic不支持
- 120501 request mqtt error 请求mqtt异常
下行 120502 sync desired attrs error 同步期望属性到MQTT端失败
- 120601 分组类型已存在 分组类型已存在
- 120602 不存在的分组类型 不存在的分组类型
- 120603 添加分组类型失败 添加分组类型失败
- 120604 分组已存在 分组已存在
- 120605 分组不存在 分组不存在
- 120606 添加分组失败 添加分组失败
- 120607 删除分组类型失败 删除分组类型失败
- 120608 删除分组失败 删除分组失败
- 120701 配置已存在 配置已存在
- 120702 配置不存在 配置不存在
- 120703 切换配置状态失败 切换配置状态失败
- 120704 查询配置异常 查询配置异常
- 120705 添加配置失败 添加配置失败
- 120706 添加配置失败 添加配置失败
- 120707 更新配置失败 更新配置失败
- 120708 该配置分组已存在 该配置分组已存在
- 120709 配置分组不存在 配置分组不存在
- 120710 配置分组添加失败 配置分组添加失败
- 120711 配置分组更新失败 配置分组更新失败
- 120712 配置分组删除失败 配置分组删除失败
- 120713 配置分组发布失败 配置分组发布失败
- 128001 已经是超级管理员 已经是超级管理员
- 128002 调用权限服务异常 调用权限服务异常
- 129903 找不到改用户 找不到改用户
- 129904 验证码出错 验证码出错

2.2 注册服务

类型 code message 中文
上行 130201 {property} is invalidation 属性验证不通过
- 130400 resource not found 资源未找到
- 130401 identity strategy not found 没找到匹配策略
- 130402 param error 参数异常
- 130403 mac not found 没有Mac地址, 无法注册
- 130502 Dynamic register not supported 设备动态注册已关闭

2.3 Broker

类型 code message 中文
设备行为 150100 Device connect 设备连接
设备行为 150101 Kicked by the same device 被相同设备踢下线
设备行为 150102 Connection reset by peer TCP连接被对端重置
设备行为 150103 Connection occurs exception 通信异常,IoT服务端主动关闭连接
设备行为 150104 Device disconnect 设备主动发送MQTT断开连接请求
设备行为 150105 Keepalive timeout 心跳超时,IoT服务端关闭连接
上行消息 150202 rule engine is offline 规则引擎下线
下行消息 150501 超时 设备回复超时
上行消息 150502 无活动连接 设备不在线或未订阅系统topic

2.4 规则引擎

类型 code message 中文
上行 160201 Send error 发送到转发地址异常
上行 160202 节点初始化失败 节点初始化失败
上行 160204 Rule not found 没找到规则, 消息丢弃
上行 160205 up message send error 上行发送异常
上行 160203 Roc return result error rpc返回值异常
上行 160206 Sync invoke error 同步调用失败
上行 160207 queue bind error rabbitmq发送失败
上行 160208 dubbo rpc send error dubbo rpc 发送失败
上行 160209 rocketmq send error rocketmq 发送失败
上行 160210 http send error http 发送失败
上行 160211 dubbo reference error dubbo reference初始化失败
上行 160401 数据流转条件不满足 数据流转条件不满足
上行 160402 sql解析异常 sql解析异常
上行 169999 unknown error 未知异常

2.5 设备SDK

类型 code message 中文
上行 170001 serialize_fail 序列化参数失败
上行 170002 publish_fail 发布失败,连接断开或发布失败
上行 170003 method_not_match 方法不匹配,如获取属性填的其他方法等(废弃)
上行 170004 timeout 超时
上行 170005 deserialize_fail 反序列化失败
上行 170006 method not support 方法不支持,处理回调没有设置
上行 170007 topic error TOPIC错误,解析下行Topic失败
上行 170008 iot isnot connect 发布失败,没有连接上IoT平台
上行 170009 mqtt except MQTT客户端发生异常
上行 170010 register failed 动态注册失败
上行 170011 reconnect timeout 重连时间超时(只触发一次,并且会继续重连)
上行 170000 ~ 170999 SDK错误段 保留错误段,设备业务端不允许使用
上行 171000 ~ 179999 设备错误段 设备业务端允许使用的错误段