# 错误反馈
为方便 bot 同学在开发 dpl 技能时快速定位展示问题和排查错误,我们在开发环境(打开调试技能模式下),提供了多种不符合 dpl 执行预期的错误反馈机制,以及对应错误类型的错误码:
# 错误码表
错误码 | 出错指令类型 | 错误信息 | 错误描述 |
---|---|---|---|
10000 | Render/ Execute | document is not a json object | document 不存在或非一个合法json对象 |
10001 | Render/ Execute | bad expression syntax: ${expression} | 解析静态绑定出错 |
10002 | Render/ Execute | invalid when expression: ${whenExp} | 解析when语法出错 |
10003 | Render/ Execute | ${reason} | 词法解析错误 |
11000 | Render/ Execute | dataSource not exist | 引用document.dataSource 不存在 |
12000 | Render/ Execute | resources not exist | 引用document.resources 不存在 |
12001 | Render/ Execute | resources should be an Array | resources 应该是一个数组类型 |
12002 | Render/ Execute | unidentified resource: ${key} | 未声明的 resource |
12003 | Render/ Execute | unsupport style:${reason} | 枚举样式值不符合预期 |
13000 | Render/ Execute | commands not exist | 引用document.commands 不存在 |
13001 | Render/ Execute | undefined command type: ${item.type} | 未声明的 command |
14000 | Render/ Execute | styles not exist | 引用document.styles 不存在 |
14001 | Render/ Execute | invalid style ${style} in document.styles | 无效的 style 类型 |
14002 | Render/ Execute | style ${item} has cyclic reference | style 存在环状引用 |
14003 | Render/ Execute | extendStyle ${extendStyle} does not exists | 继承style不存在 |
15000 | Render/ Execute | layouts not exist | 引用document.layouts 不存在 |
15001 | Render/ Execute | undefined layout type: ${item.type} | 未声明的 layout |
15002 | Render/ Execute | layout ${item} has cyclic reference | layout 存在环状引用 |
16000 | Render/ Execute | stylesheet not exist | 引用document.stylesheet 不存在 |
17000 | Render/ Execute | abilities not exist | 引用document.abilities 不存在 |
17001 | Render/ Execute | undefined ability type: ${item.type} in ablities | 未声明的 ability |
18000 | Render/ Execute | mainTemplate not exsit | 引用document.mainTemplate 不存在 |
18001 | Render/ Execute | undefined component type: ${item.type} | 未声明的组件类型 |
18002 | Render/ Execute | undefined component reference style: ${style} in styles | 未识别的组件引用style |
18003 | Render/ Execute | undefined component reference layout: ${layout} in layouts | 未识别的组件引用layout |
18004 | Render/ Execute | undefined component reference style: ${value} in resources | 未识别的组件引用resources value |
19999 | Render/ Execute | unclassified error | 未归类的其他错误 |
20000 | Execute | execute commands not in legal format | command 格式非法 |
20001 | Execute | the commands module wasn't ready | 指令模块未初始化完成 |
20002 | Execute | the page rendering wasn't ready | 页面渲染尚未初始化完成 |
20003 | Execute | fail on executing command: ${type} | 端执行指令失败 |
29999 | Render/ Execute | unclassified error | 未归类的其他错误 |
# Render指令错误反馈
当在开发环境下使用 dpl 渲染指令(Render)下发内容时,若当前指令中包含内容不符合协议或者解析出错,会跳转到一个包含相关错误信息的友好提示页面,页面中内容包含:
{
"errMsg": "undefined component type: ScrollVie",
"code": "18001",
"traceId": "015643c1"
}
# 参数描述
- code
- 对应的错误码
- errMsg
- 对应错误码的错误描述信息
- traceId
- 对应指令的requestId(logId)前缀
# Execute指令错误反馈
当在开发环境下使用 dpl 功能指令(Execute)下发内容在对应 dpl 渲染模板上执行出错,或基于事件的预绑定指令执行出错,会弹出一个 toast 提示并上报一个 包含具体错误反馈信息的 UserEvent 事件反馈给 bot;
{
"token": "58dfb7f9-eebd-4802-8605-79df6b364648",
"payload": {
"source": {
"code": 20003,
"errMsg": "failed on executing command UpdateDataSour",
"from": "prebind",
"reason": "t._commands[(\"on\" + e.type)] is not a function",
"traceId": "d223e95f"
}
},
"type": "UserEvent",
...
}
# 参数描述
- code
- 对应的错误码
- errMsg
- 对应错误码的错误描述信息
- from
- 指令产生的来源方:prebind(事件预绑定)、send(bot下发)
- reason
- 导致错误的设备端执行内容描述
- traceId
- 对应指令的requestId(logId)前缀
← UserEvent 事件 通用样式 →