You need to sign in or sign up before continuing.
未验证 提交 055a912e 编写于 作者: O openharmony_ci 提交者: Gitee

!5384 翻译完成:5091 新增err.code返回结果

Merge pull request !5384 from wusongqing/TR5091V2
...@@ -41,7 +41,7 @@ If a service needs to be continued when the application or service module is run ...@@ -41,7 +41,7 @@ If a service needs to be continued when the application or service module is run
backgroundTaskManager.getRemainingDelayTime(id).then( res => { backgroundTaskManager.getRemainingDelayTime(id).then( res => {
console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
}).catch( err => { }).catch( err => {
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data); console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code);
}); });
``` ```
...@@ -74,7 +74,7 @@ console.info("The actualDelayTime is: " + time); ...@@ -74,7 +74,7 @@ console.info("The actualDelayTime is: " + time);
backgroundTaskManager.getRemainingDelayTime(id).then( res => { backgroundTaskManager.getRemainingDelayTime(id).then( res => {
console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
}).catch( err => { }).catch( err => {
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data); console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code);
}); });
// Cancel the suspension delay. // Cancel the suspension delay.
......
...@@ -67,10 +67,10 @@ Obtains the remaining duration before the application is suspended. This API use ...@@ -67,10 +67,10 @@ Obtains the remaining duration before the application is suspended. This API use
```js ```js
let id = 1; let id = 1;
backgroundTaskManager.getRemainingDelayTime(id, (err, res) => { backgroundTaskManager.getRemainingDelayTime(id, (err, res) => {
if(err.data === 0) { if(err) {
console.log('callback => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); console.log('callback => Operation getRemainingDelayTime failed. Cause: ' + err.code);
} else { } else {
console.log('callback => Operation getRemainingDelayTime failed. Cause: ' + err.data); console.log('callback => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
} }
}) })
``` ```
...@@ -100,7 +100,7 @@ Obtains the remaining duration before the application is suspended. This API use ...@@ -100,7 +100,7 @@ Obtains the remaining duration before the application is suspended. This API use
backgroundTaskManager.getRemainingDelayTime(id).then( res => { backgroundTaskManager.getRemainingDelayTime(id).then( res => {
console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res));
}).catch( err => { }).catch( err => {
console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data); console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code);
}) })
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册