diff --git a/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md b/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md index 1eeefe3c9a6dc787c90341ff71ce18e5b758c180..f932bfda156c2af45ea3514c35cba2ac55d27e1c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md +++ b/zh-cn/application-dev/reference/apis/js-apis-workScheduler.md @@ -100,7 +100,7 @@ getWorkStatus(workId: number, callback : AsyncCallback\): void ``` workScheduler.getWorkStatus(50, (err, res) => { if (err) { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); } else { for (let item in res) { console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); @@ -136,7 +136,7 @@ getWorkStatus(workId: number): Promise\ console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); } }).catch((err) => { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); }) ``` @@ -164,7 +164,7 @@ obtainAllWorks(callback : AsyncCallback\): Array\ ``` workScheduler.obtainAllWorks((err, res) =>{ if (err) { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); } else { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); } @@ -190,7 +190,7 @@ obtainAllWorks(): Promise> workScheduler.obtainAllWorks().then((res) => { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); }).catch((err) => { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); }) ``` @@ -233,7 +233,7 @@ isLastWorkTimeOut(workId: number, callback : AsyncCallback\): boolean ``` workScheduler.isLastWorkTimeOut(500, (err, res) =>{ if (err) { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); } else { console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); } @@ -267,7 +267,7 @@ isLastWorkTimeOut(workId: number): Promise\ console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); }) .catch(err => { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); }); ``` diff --git a/zh-cn/application-dev/work-scheduler/work-scheduler-dev-guide.md b/zh-cn/application-dev/work-scheduler/work-scheduler-dev-guide.md index 43cabe327ff8a1cf8280270ed96742ab65886874..e8f504d8be709881243dc8b4ec5bc945e4cd15b4 100644 --- a/zh-cn/application-dev/work-scheduler/work-scheduler-dev-guide.md +++ b/zh-cn/application-dev/work-scheduler/work-scheduler-dev-guide.md @@ -115,7 +115,7 @@ function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调 workScheduler.getWorkStatus(50, (err, res) => { if (err) { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); } else { for (let item in res) { console.info('workschedulerLog getWorkStatuscallback success,' + item + ' is:' + res[item]); @@ -131,7 +131,7 @@ function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调 console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); } }).catch((err) => { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); }) @@ -141,7 +141,7 @@ function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调 workScheduler.obtainAllWorks((err, res) =>{ if (err) { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); } else { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); } @@ -152,7 +152,7 @@ function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调 workScheduler.obtainAllWorks().then((res) => { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); }).catch((err) => { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); }) **停止并清除任务** @@ -166,7 +166,7 @@ function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调 workScheduler.isLastWorkTimeOut(500, (err, res) =>{ if (err) { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); } else { console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); } @@ -179,6 +179,6 @@ function onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调 console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); }) .catch(err => { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); }); }) \ No newline at end of file