提交 e12eb688 编写于 作者: zyjhandsome's avatar zyjhandsome

优化errorManager部分示例代码。

Signed-off-by: zyjhandsome's avatarzyjhandsome <zyjhandsome@126.com>
上级 ec2a3982
......@@ -22,15 +22,14 @@ onUnhandledException(errMsg: string): void;
import errorManager from '@ohos.app.ability.errorManager';
let observer = {
onUnhandledException(errorMsg) {
console.log('onUnhandledException, errorMsg: ', errorMsg);
}
onUnhandledException(errorMsg) {
console.log('onUnhandledException, errorMsg: ', errorMsg);
}
};
try {
errorManager.on('error', observer);
} catch (error) {
console.log('registerErrorObserver' + ' failed, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
errorManager.on('error', observer);
} catch (err) {
console.log(`registerErrorObserver failed, code is ${err.code}, message is ${err.message}`);
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册