提交 c2425668 编写于 作者: @ @shi-xiaoxiao-iris

api 示例错误处理

Signed-off-by: N@shi-xiaoxiao-iris <shixiaoxiao2@huawei.com>
上级 ec7c861b
......@@ -301,12 +301,12 @@ getTrustedDeviceList(): Promise&lt;Array&lt;DeviceInfo&gt;&gt;
});
try {
dmInstance.getTrustedDeviceList().then((data) => {
console.log('[myApiTest]get trusted device info: ' + JSON.stringify(data));
console.log('get trusted device info: ' + JSON.stringify(data));
}).catch((err) => {
console.error("[myApiTest]getTrustedDeviceList errCode:" + err.code + ",errorMessage:" + err.message);
console.error("getTrustedDeviceList errCode:" + err.code + ",errorMessage:" + err.message);
});
} catch (err) {
console.error("[myApiTest]getTrustedDeviceList errCode:" + err.code + ",errorMessage:" + err.message);
console.error("getTrustedDeviceList errCode:" + err.code + ",errorMessage:" + err.message);
}
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册