Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
a466aedf
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a466aedf
编写于
4月 06, 2023
作者:
O
openharmony_ci
提交者:
Gitee
4月 06, 2023
浏览文件
操作
浏览文件
下载
差异文件
!16927 去掉无意义的JSON.stringify
Merge pull request !16927 from zhoujun62/my_doc_vod
上级
64d59bb5
78add5f9
变更
37
隐藏空白更改
内联
并排
Showing
37 changed file
with
280 addition
and
280 deletion
+280
-280
en/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
...-dev/reference/apis/js-apis-app-ability-abilityManager.md
+6
-6
en/application-dev/reference/apis/js-apis-app-ability-missionManager.md
...-dev/reference/apis/js-apis-app-ability-missionManager.md
+2
-2
en/application-dev/reference/apis/js-apis-app-ability-startOptions.md
...on-dev/reference/apis/js-apis-app-ability-startOptions.md
+1
-1
en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md
...ation-dev/reference/apis/js-apis-app-ability-uiAbility.md
+16
-16
en/application-dev/reference/apis/js-apis-app-ability-wantAgent.md
...ation-dev/reference/apis/js-apis-app-ability-wantAgent.md
+41
-41
en/application-dev/reference/apis/js-apis-application-missionManager.md
...-dev/reference/apis/js-apis-application-missionManager.md
+9
-9
en/application-dev/reference/apis/js-apis-inner-application-appStateData.md
.../reference/apis/js-apis-inner-application-appStateData.md
+1
-1
en/application-dev/reference/apis/js-apis-inner-application-context.md
...n-dev/reference/apis/js-apis-inner-application-context.md
+4
-4
en/application-dev/reference/apis/js-apis-inner-application-continueCallback.md
...erence/apis/js-apis-inner-application-continueCallback.md
+1
-1
en/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md
...ence/apis/js-apis-inner-application-continueDeviceInfo.md
+1
-1
en/application-dev/reference/apis/js-apis-inner-application-errorObserver.md
...reference/apis/js-apis-inner-application-errorObserver.md
+1
-1
en/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md
...ce/apis/js-apis-inner-application-extensionRunningInfo.md
+1
-1
en/application-dev/reference/apis/js-apis-inner-application-missionInfo.md
...v/reference/apis/js-apis-inner-application-missionInfo.md
+1
-1
en/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md
...ference/apis/js-apis-inner-application-missionSnapshot.md
+2
-2
en/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md
...apis/js-apis-inner-application-serviceExtensionContext.md
+40
-40
en/application-dev/reference/apis/js-apis-inner-application-windowExtensionContext.md
.../apis/js-apis-inner-application-windowExtensionContext.md
+4
-4
en/application-dev/reference/apis/js-apis-inputdevice.md
en/application-dev/reference/apis/js-apis-inputdevice.md
+3
-3
en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-ability.md
...tes/changelogs/OpenHarmony_3.2.10.7/changelogs-ability.md
+4
-4
en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md
...es/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md
+3
-3
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
...-dev/reference/apis/js-apis-app-ability-abilityManager.md
+6
-6
zh-cn/application-dev/reference/apis/js-apis-app-ability-missionManager.md
...-dev/reference/apis/js-apis-app-ability-missionManager.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-app-ability-startOptions.md
...on-dev/reference/apis/js-apis-app-ability-startOptions.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md
...ation-dev/reference/apis/js-apis-app-ability-uiAbility.md
+16
-16
zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md
...ation-dev/reference/apis/js-apis-app-ability-wantAgent.md
+41
-41
zh-cn/application-dev/reference/apis/js-apis-application-missionManager.md
...-dev/reference/apis/js-apis-application-missionManager.md
+9
-9
zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md
.../reference/apis/js-apis-inner-application-appStateData.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md
...n-dev/reference/apis/js-apis-inner-application-context.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-inner-application-continueCallback.md
...erence/apis/js-apis-inner-application-continueCallback.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md
...ence/apis/js-apis-inner-application-continueDeviceInfo.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-errorObserver.md
...reference/apis/js-apis-inner-application-errorObserver.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md
...ce/apis/js-apis-inner-application-extensionRunningInfo.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md
...v/reference/apis/js-apis-inner-application-missionInfo.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md
...ference/apis/js-apis-inner-application-missionSnapshot.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md
...apis/js-apis-inner-application-serviceExtensionContext.md
+40
-40
zh-cn/application-dev/reference/apis/js-apis-inner-application-windowExtensionContext.md
.../apis/js-apis-inner-application-windowExtensionContext.md
+4
-4
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-ability.md
...tes/changelogs/OpenHarmony_3.2.10.7/changelogs-ability.md
+4
-4
zh-cn/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md
...es/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md
+3
-3
未找到文件。
en/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
浏览文件 @
a466aedf
...
...
@@ -79,7 +79,7 @@ try {
}
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -135,7 +135,7 @@ try {
console
.
error
(
'
updateConfiguration fail, err: ${JSON.stringify(err)}
'
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -177,7 +177,7 @@ try {
}
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -217,7 +217,7 @@ try {
console
.
error
(
'
getAbilityRunningInfos fail, err: ${JSON.stringify(err)}
'
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -262,7 +262,7 @@ try {
}
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -310,7 +310,7 @@ try {
console
.
error
(
'
getExtensionRunningInfos fail, err: ${JSON.stringify(err)}
'
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
en/application-dev/reference/apis/js-apis-app-ability-missionManager.md
浏览文件 @
a466aedf
...
...
@@ -306,7 +306,7 @@ Obtains the information about a given mission. This API uses an asynchronous cal
missionManager
.
getMissionInfo
(
''
,
testMissionId
,
(
error
,
mission
)
=>
{
if
(
error
)
{
console
.
error
(
'
getMissionInfo failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfo failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
else
{
console
.
log
(
'
mission.missionId = ${mission.missionId}
'
);
console
.
log
(
'
mission.runningState = ${mission.runningState}
'
);
...
...
@@ -392,7 +392,7 @@ Obtains information about all missions. This API uses an asynchronous callback t
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
else
{
console
.
log
(
'
size = ${missions.length}
'
);
console
.
log
(
'
missions = ${JSON.stringify(missions)}
'
);
...
...
en/application-dev/reference/apis/js-apis-app-ability-startOptions.md
浏览文件 @
a466aedf
...
...
@@ -33,7 +33,7 @@ import StartOptions from '@ohos.app.ability.StartOptions';
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md
浏览文件 @
a466aedf
...
...
@@ -375,10 +375,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
console
.
log
(
'
Caller call() called
'
);
})
.
catch
((
callErr
)
=>
{
console
.
log
(
'
Caller.call catch error, error.code: ${
JSON.stringify(callErr.code)}, error.message: ${JSON.stringify(callErr.message)
}
'
);
console
.
log
(
'
Caller.call catch error, error.code: ${
callErr.code}, error.message: ${callErr.message
}
'
);
});
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -456,10 +456,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
data
.
readParcelable
(
retmsg
);
})
.
catch
((
callErr
)
=>
{
console
.
log
(
'
Caller.callWithResult catch error, error.code: ${
JSON.stringify(callErr.code)}, error.message: ${JSON.stringify(callErr.message)
}
'
);
console
.
log
(
'
Caller.callWithResult catch error, error.code: ${
callErr.code}, error.message: ${callErr.message
}
'
);
});
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -498,10 +498,10 @@ Releases the caller interface of the target ability.
try
{
caller
.
release
();
}
catch
(
releaseErr
)
{
console
.
log
(
'
Caller.release catch error, error.code: ${
JSON.stringify(releaseErr.code)}, error.message: ${JSON.stringify(releaseErr.message)
}
'
);
console
.
log
(
'
Caller.release catch error, error.code: ${
releaseErr.code}, error.message: ${releaseErr.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -538,10 +538,10 @@ Registers a callback that is invoked when the stub on the target ability is disc
console
.
log
(
'
Caller OnRelease CallBack is called ${str}
'
);
});
}
catch
(
error
)
{
console
.
log
(
'
Caller.onRelease catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Caller.onRelease catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -587,10 +587,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
console
.
log
(
'
Caller OnRelease CallBack is called ${str}
'
);
});
}
catch
(
error
)
{
console
.
log
(
'
Caller.on catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Caller.on catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -637,10 +637,10 @@ For other IDs, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
caller
.
on
(
'
release
'
,
onReleaseCallBack
);
caller
.
off
(
'
release
'
,
onReleaseCallBack
);
}
catch
(
error
)
{
console
.
log
(
'
Caller.on or Caller.off catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Caller.on or Caller.off catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -686,10 +686,10 @@ For other IDs, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
caller
.
on
(
'
release
'
,
onReleaseCallBack
);
caller
.
off
(
'
release
'
);
}
catch
(
error
)
{
console
.
error
(
'
Caller.on or Caller.off catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
Caller.on or Caller.off catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
error
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -759,7 +759,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
try
{
this
.
callee
.
on
(
method
,
funcCallBack
);
}
catch
(
error
)
{
console
.
log
(
'
Callee.on catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Callee.on catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}
}
...
...
@@ -798,7 +798,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
try
{
this
.
callee
.
off
(
method
);
}
catch
(
error
)
{
console
.
log
(
'
Callee.off catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Callee.off catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}
}
...
...
en/application-dev/reference/apis/js-apis-app-ability-wantAgent.md
浏览文件 @
a466aedf
...
...
@@ -186,10 +186,10 @@ try {
WantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
wantAgent
=
data
;
}).
catch
((
err
)
=>
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -280,7 +280,7 @@ function getWantAgentCallback(err, data) {
// getBundleName callback
function
getBundleNameCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getBundleName failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getBundleName failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getBundleName ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -288,13 +288,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
getBundleName
(
wantAgent
,
getBundleNameCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getBundleName failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getBundleName failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -391,16 +391,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
getBundleName
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
getBundleName ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getBundleName failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getBundleName failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
getBundleName failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getBundleName failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -492,7 +492,7 @@ function getWantAgentCallback(err, data) {
// getUid callback
function
getUidCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -500,13 +500,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
getUid
(
wantAgent
,
getUidCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -603,16 +603,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
getUid
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -704,7 +704,7 @@ function getWantAgentCallback(err, data) {
// getWant callback
function
getWantCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getWant failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWant failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getWant ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -712,13 +712,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
getWant
(
wantAgent
,
getWantCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWant failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWant failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -817,16 +817,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
getUid
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -917,7 +917,7 @@ function getWantAgentCallback(err, data) {
// cancel callback
function
cancelCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
cancel failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
cancel failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
cancel ok!
'
);
}
...
...
@@ -925,13 +925,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
cancel
(
wantAgent
,
cancelCallback
);
}
catch
(
err
)
{
console
.
error
(
'
cancel failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
cancel failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1028,16 +1028,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
cancel
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
cancel ok!
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
cancel failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
cancel failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
cancel failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
cancel failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1131,7 +1131,7 @@ function getWantAgentCallback(err, data) {
// trigger callback
function
triggerCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -1139,13 +1139,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
trigger
(
wantAgent
,
triggerInfo
,
triggerCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1239,7 +1239,7 @@ function getWantAgentCallback(err, data) {
// equal callback
function
equalCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
equal failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
equal failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
equal ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -1247,13 +1247,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
equal
(
wantAgent1
,
wantAgent2
,
equalCallback
);
}
catch
(
err
)
{
console
.
error
(
'
equal failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
equal failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1353,16 +1353,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
equal
(
wantAgent1
,
wantAgent2
).
then
((
data
)
=>
{
console
.
info
(
'
equal ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
equal failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
equal failed! ${
err.code} ${err.message
}
'
);
})
}
catch
(
err
){
console
.
error
(
'
equal failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
equal failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1451,7 +1451,7 @@ function getWantAgentCallback(err, data) {
// getOperationTypeCallback callback
function
getOperationTypeCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getOperationType failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getOperationType failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getOperationType ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -1459,13 +1459,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
getOperationTypeCallback
(
wantAgent
,
getOperationTypeCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getOperationTypeCallback failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getOperationTypeCallback failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1560,16 +1560,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
getOperationType
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
getOperationType ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getOperationType failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getOperationType failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
getOperationType failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getOperationType failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
en/application-dev/reference/apis/js-apis-application-missionManager.md
浏览文件 @
a466aedf
...
...
@@ -170,7 +170,7 @@ Obtains the information about a given mission. This API uses an asynchronous cal
let
allMissions
=
missionManager
.
getMissionInfos
(
''
,
10
).
catch
(
function
(
err
){
console
.
log
(
err
);});
missionManager
.
getMissionInfo
(
''
,
allMissions
[
0
].
missionId
,
(
error
,
mission
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfo failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfo failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
...
...
@@ -247,7 +247,7 @@ Obtains information about all missions. This API uses an asynchronous callback t
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -319,7 +319,7 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -328,7 +328,7 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback
missionManager
.
getMissionSnapShot
(
''
,
id
,
(
error
,
snapshot
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionSnapShot failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionSnapShot failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
bundleName = ${snapshot.ability.bundleName}
'
);
...
...
@@ -408,7 +408,7 @@ Locks a given mission. This API uses an asynchronous callback to return the resu
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -492,7 +492,7 @@ Unlocks a given mission. This API uses an asynchronous callback to return the re
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -580,7 +580,7 @@ Clears a given mission, regardless of whether it is locked. This API uses an asy
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -716,7 +716,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -757,7 +757,7 @@ Switches a given mission to the foreground, with the startup parameters for the
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
en/application-dev/reference/apis/js-apis-inner-application-appStateData.md
浏览文件 @
a466aedf
...
...
@@ -20,7 +20,7 @@ import appManager from '@ohos.app.ability.appManager';
function
getForegroundAppInfos
()
{
appManager
.
getForegroundApplications
((
error
,
data
)
=>
{
if
(
error
&&
error
.
code
)
{
console
.
log
(
'
getForegroundApplications failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
getForegroundApplications failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
en/application-dev/reference/apis/js-apis-inner-application-context.md
浏览文件 @
a466aedf
...
...
@@ -62,7 +62,7 @@ let bundleContext;
try
{
bundleContext
=
this
.
context
.
createBundleContext
(
'
com.example.test
'
);
}
catch
(
error
)
{
console
.
error
(
'
createBundleContext failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
createBundleContext failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
...
...
@@ -101,7 +101,7 @@ let moduleContext;
try
{
moduleContext
=
this
.
context
.
createModuleContext
(
'
entry
'
);
}
catch
(
error
)
{
console
.
error
(
'
createModuleContext failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
createModuleContext failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
...
...
@@ -141,7 +141,7 @@ let moduleContext;
try
{
moduleContext
=
this
.
context
.
createModuleContext
(
'
com.example.test
'
,
'
entry
'
);
}
catch
(
error
)
{
console
.
error
(
'
createModuleContext failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
createModuleContext failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
...
...
@@ -166,6 +166,6 @@ let applicationContext;
try
{
applicationContext
=
this
.
context
.
getApplicationContext
();
}
catch
(
error
)
{
console
.
error
(
'
getApplicationContext failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getApplicationContext failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
en/application-dev/reference/apis/js-apis-inner-application-continueCallback.md
浏览文件 @
a466aedf
...
...
@@ -38,7 +38,7 @@ Called when the mission continuation is complete.
distributedMissionManager
.
continueMission
(
continueDeviceInfo
,
continueCallback
,
(
error
)
=>
{
if
(
error
&&
error
.
code
)
{
console
.
error
(
'
continueMission failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
continueMission failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
console
.
log
(
'
continueMission finished
'
);
});
...
...
en/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md
浏览文件 @
a466aedf
...
...
@@ -33,7 +33,7 @@ The **ContinueDeviceInfo** module defines the parameters required for initiating
distributedMissionManager
.
continueMission
(
continueDeviceInfo
,
continueCallback
,
(
error
)
=>
{
if
(
error
&&
error
.
code
)
{
console
.
error
(
'
continueMission failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
continueMission failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
console
.
log
(
'
continueMission finished
'
);
});
...
...
en/application-dev/reference/apis/js-apis-inner-application-errorObserver.md
浏览文件 @
a466aedf
...
...
@@ -30,6 +30,6 @@ let observer = {
try
{
errorManager
.
on
(
'
error
'
,
observer
);
}
catch
(
error
)
{
console
.
error
(
'
registerErrorObserver failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
registerErrorObserver failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
en/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md
浏览文件 @
a466aedf
...
...
@@ -33,7 +33,7 @@ let upperLimit = 1;
function
getExtensionInfos
()
{
abilityManager
.
getExtensionRunningInfos
(
upperLimit
,
(
error
,
data
)
=>
{
if
(
error
&&
error
.
code
)
{
console
.
error
(
'
getForegroundApplications failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getForegroundApplications failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
...
...
en/application-dev/reference/apis/js-apis-inner-application-missionInfo.md
浏览文件 @
a466aedf
...
...
@@ -25,7 +25,7 @@ try {
missionManager
.
getMissionInfo
(
''
,
1
,
(
error
,
data
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
getMissionInfo failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfo failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
...
...
en/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md
浏览文件 @
a466aedf
...
...
@@ -27,7 +27,7 @@ The mission snapshot information can be obtained by using **getMissionSnapShot**
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -36,7 +36,7 @@ The mission snapshot information can be obtained by using **getMissionSnapShot**
missionManager
.
getMissionSnapShot
(
''
,
id
,
(
err
,
snapshot
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
getMissionInfos failed, err.code: ${
JSON.stringify(err.code)}, err.message: ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, err.code: ${
err.code}, err.message: ${err.message
}
'
);
return
;
}
...
...
en/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md
浏览文件 @
a466aedf
...
...
@@ -79,7 +79,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
this
.
context
.
startAbility
(
want
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -87,7 +87,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -158,11 +158,11 @@ Starts an ability. This API uses a promise to return the result.
})
.
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -225,7 +225,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
this
.
context
.
startAbility
(
want
,
options
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -233,7 +233,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -300,7 +300,7 @@ Observe the following when using this API:
this
.
context
.
startAbilityWithAccount
(
want
,
accountId
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -308,7 +308,7 @@ Observe the following when using this API:
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -379,7 +379,7 @@ Observe the following when using this API:
this
.
context
.
startAbilityWithAccount
(
want
,
accountId
,
options
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -387,7 +387,7 @@ Observe the following when using this API:
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -468,11 +468,11 @@ Observe the following when using this API:
})
.
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -523,7 +523,7 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to
this
.
context
.
startServiceExtensionAbility
(
want
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
startServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -531,7 +531,7 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -591,11 +591,11 @@ Starts a new ServiceExtensionAbility. This API uses a promise to return the resu
})
.
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
startServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -652,7 +652,7 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use
this
.
context
.
startServiceExtensionAbilityWithAccount
(
want
,
accountId
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
startServiceExtensionAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startServiceExtensionAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -660,7 +660,7 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -725,11 +725,11 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use
})
.
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
startServiceExtensionAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startServiceExtensionAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -777,7 +777,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch
this
.
context
.
stopServiceExtensionAbility
(
want
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
stopServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
stopServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -785,7 +785,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -842,11 +842,11 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise
})
.
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
stopServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
stopServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -899,7 +899,7 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec
this
.
context
.
stopServiceExtensionAbilityWithAccount
(
want
,
accountId
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
stopServiceExtensionAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code), error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
stopServiceExtensionAbilityWithAccount failed, error.code: ${
error.code, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -907,7 +907,7 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -969,11 +969,11 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec
})
.
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
stopServiceExtensionAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
stopServiceExtensionAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1010,7 +1010,7 @@ Terminates this ability. This API uses an asynchronous callback to return the re
this
.
context
.
terminateSelf
((
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
terminateSelf failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
terminateSelf failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -1053,7 +1053,7 @@ Terminates this ability. This API uses a promise to return the result.
console
.
log
(
'
terminateSelf succeed
'
);
}).
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
terminateSelf failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
terminateSelf failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
```
...
...
@@ -1113,7 +1113,7 @@ Connects this ability to a ServiceExtensionAbility.
connection
=
this
.
context
.
connectServiceExtensionAbility
(
want
,
options
);
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1177,7 +1177,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect
connection
=
this
.
context
.
connectServiceExtensionAbilityWithAccount
(
want
,
accountId
,
options
);
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1220,7 +1220,7 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful
commRemote
=
null
;
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
disconnectServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
disconnectServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -1229,7 +1229,7 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful
}
catch
(
paramError
)
{
commRemote
=
null
;
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1282,12 +1282,12 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful
.
catch
((
error
)
=>
{
commRemote
=
null
;
// Process service logic errors.
console
.
error
(
'
disconnectServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
disconnectServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
commRemote
=
null
;
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1356,11 +1356,11 @@ Observe the following when using this API:
console
.
log
(
'
startAbilityByCall succeed
'
);
}).
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
startAbilityByCall failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityByCall failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1388,10 +1388,10 @@ Observe the following when using this API:
console
.
log
(
'
startAbilityByCall succeed
'
);
}).
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
startAbilityByCall failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityByCall failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
en/application-dev/reference/apis/js-apis-inner-application-windowExtensionContext.md
浏览文件 @
a466aedf
...
...
@@ -58,7 +58,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
this
.
context
.
startAbility
(
want
,
options
,
(
error
)
=>
{
if
(
error
.
code
)
{
// Process service logic errors.
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// Carry out normal service processing.
...
...
@@ -66,7 +66,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -110,10 +110,10 @@ Starts an ability. This API uses a promise to return the result.
})
.
catch
((
error
)
=>
{
// Process service logic errors.
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// Process input parameter errors.
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
en/application-dev/reference/apis/js-apis-inputdevice.md
浏览文件 @
a466aedf
...
...
@@ -31,7 +31,7 @@ try {
inputDevice
.
getDeviceIds
((
error
,
ids
)
=>
{
if
(
error
)
{
console
.
log
(
`Failed to get device list.
error code=
${
JSON
.
stringify
(
err
.
code
)}
msg=
${
JSON
.
stringify
(
err
.
message
)
}
`
);
error code=
${
err
.
code
}
msg=
${
err
.
message
}
`
);
return
;
}
this
.
data
=
ids
;
...
...
@@ -91,7 +91,7 @@ try {
inputDevice
.
getDeviceInfo
(
1
,
(
error
,
inputDevice
)
=>
{
if
(
error
)
{
console
.
log
(
`Failed to get device information.
error code=
${
JSON
.
stringify
(
err
.
code
)}
msg=
${
JSON
.
stringify
(
err
.
message
)
}
`
);
error code=
${
err
.
code
}
msg=
${
err
.
message
}
`
);
return
;
}
console
.
log
(
"
The device name is:
"
+
inputDevice
.
name
);
...
...
@@ -421,7 +421,7 @@ try {
inputDevice.getKeyboardType(1, (error, number) => {
if (error) {
console.log(
`Failed to get keyboardtype.
error code=${
JSON.stringify(err.code)} msg=${JSON.stringify(err.message)
}`
);
error code=${
err.code} msg=${err.message
}`
);
return;
}
console.log("The keyboard type of the device is: " + number);
...
...
en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-ability.md
浏览文件 @
a466aedf
...
...
@@ -216,8 +216,8 @@ Code before the change:
try
{
this
.
callee
.
on
(
method
,
funcCallBack
);
}
catch
(
error
)
{
console
.
log
(
'
Callee.on catch error, error.code:
'
+
JSON
.
stringify
(
error
.
code
)
+
'
error.message:
'
+
JSON
.
stringify
(
error
.
message
)
);
console
.
log
(
'
Callee.on catch error, error.code:
'
+
error
.
code
+
'
error.message:
'
+
error
.
message
);
}
}
}
...
...
@@ -260,8 +260,8 @@ Code after the change:
try
{
this
.
callee
.
on
(
method
,
funcCallBack
);
}
catch
(
error
)
{
console
.
log
(
'
Callee.on catch error, error.code:
'
+
JSON
.
stringify
(
error
.
code
)
+
'
error.message:
'
+
JSON
.
stringify
(
error
.
message
)
);
console
.
log
(
'
Callee.on catch error, error.code:
'
+
error
.
code
+
'
error.message:
'
+
error
.
message
);
}
}
}
...
...
en/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md
浏览文件 @
a466aedf
...
...
@@ -71,7 +71,7 @@ function getWantAgentCallback(err, data) {
// getUid callback
function
triggerCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
'
getUid failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
)
);
console
.
info
(
'
getUid failed!
'
+
err
.
code
+
err
.
message
);
}
else
{
console
.
info
(
'
getUid ok!
'
+
JSON
.
stringify
(
data
));
}
...
...
@@ -79,12 +79,12 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
trigger
(
wantAgent
,
triggerInfo
,
triggerCallback
);
}
catch
(
err
)
{
console
.
info
(
'
getUid failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
)
);
console
.
info
(
'
getUid failed!
'
+
err
.
code
+
err
.
message
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
){
console
.
info
(
'
getWantAgent failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
)
);
console
.
info
(
'
getWantAgent failed!
'
+
err
.
code
+
err
.
message
);
}
```
zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md
浏览文件 @
a466aedf
...
...
@@ -79,7 +79,7 @@ try {
}
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -135,7 +135,7 @@ try {
console
.
error
(
'
updateConfiguration fail, err: ${JSON.stringify(err)}
'
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -177,7 +177,7 @@ try {
}
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -217,7 +217,7 @@ try {
console
.
error
(
'
getAbilityRunningInfos fail, err: ${JSON.stringify(err)}
'
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -262,7 +262,7 @@ try {
}
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -310,7 +310,7 @@ try {
console
.
error
(
'
getExtensionRunningInfos fail, err: ${JSON.stringify(err)}
'
);
});
}
catch
(
paramError
)
{
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-missionManager.md
浏览文件 @
a466aedf
...
...
@@ -306,7 +306,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<M
missionManager
.
getMissionInfo
(
''
,
testMissionId
,
(
error
,
mission
)
=>
{
if
(
error
)
{
console
.
error
(
'
getMissionInfo failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfo failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
else
{
console
.
log
(
'
mission.missionId = ${mission.missionId}
'
);
console
.
log
(
'
mission.runningState = ${mission.runningState}
'
);
...
...
@@ -392,7 +392,7 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Arr
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
else
{
console
.
log
(
'
size = ${missions.length}
'
);
console
.
log
(
'
missions = ${JSON.stringify(missions)}
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-startOptions.md
浏览文件 @
a466aedf
...
...
@@ -33,7 +33,7 @@ import StartOptions from '@ohos.app.ability.StartOptions';
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md
浏览文件 @
a466aedf
...
...
@@ -402,10 +402,10 @@ call(method: string, data: rpc.Parcelable): Promise<void>;
console
.
log
(
'
Caller call() called
'
);
})
.
catch
((
callErr
)
=>
{
console
.
log
(
'
Caller.call catch error, error.code: ${
JSON.stringify(callErr.code)}, error.message: ${JSON.stringify(callErr.message)
}
'
);
console
.
log
(
'
Caller.call catch error, error.code: ${
callErr.code}, error.message: ${callErr.message
}
'
);
});
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -483,10 +483,10 @@ callWithResult(method: string, data: rpc.Parcelable): Promise<rpc.MessageSequ
data
.
readParcelable
(
retmsg
);
})
.
catch
((
callErr
)
=>
{
console
.
log
(
'
Caller.callWithResult catch error, error.code: ${
JSON.stringify(callErr.code)}, error.message: ${JSON.stringify(callErr.message)
}
'
);
console
.
log
(
'
Caller.callWithResult catch error, error.code: ${
callErr.code}, error.message: ${callErr.message
}
'
);
});
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -525,10 +525,10 @@ release(): void;
try
{
caller
.
release
();
}
catch
(
releaseErr
)
{
console
.
log
(
'
Caller.release catch error, error.code: ${
JSON.stringify(releaseErr.code)}, error.message: ${JSON.stringify(releaseErr.message)
}
'
);
console
.
log
(
'
Caller.release catch error, error.code: ${
releaseErr.code}, error.message: ${releaseErr.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -565,10 +565,10 @@ release(): void;
console
.
log
(
'
Caller OnRelease CallBack is called ${str}
'
);
});
}
catch
(
error
)
{
console
.
log
(
'
Caller.onRelease catch error, error.code: $
{JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Caller.onRelease catch error, error.code: $
error.code}, error.message: ${error.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -614,10 +614,10 @@ release(): void;
console
.
log
(
'
Caller OnRelease CallBack is called ${str}
'
);
});
}
catch
(
error
)
{
console
.
log
(
'
Caller.on catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Caller.on catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -664,10 +664,10 @@ off(type: 'release', callback: OnReleaseCallback): void;
caller
.
on
(
'
release
'
,
onReleaseCallBack
);
caller
.
off
(
'
release
'
,
onReleaseCallBack
);
}
catch
(
error
)
{
console
.
log
(
'
Caller.on or Caller.off catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Caller.on or Caller.off catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
log
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
log
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -713,10 +713,10 @@ off(type: 'release'): void;
caller
.
on
(
'
release
'
,
onReleaseCallBack
);
caller
.
off
(
'
release
'
);
}
catch
(
error
)
{
console
.
error
(
'
Caller.on or Caller.off catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
Caller.on or Caller.off catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}).
catch
((
err
)
=>
{
console
.
error
(
'
Caller GetCaller error, error.code: ${
JSON.stringify(err.code)}, error.message: ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
Caller GetCaller error, error.code: ${
err.code}, error.message: ${err.message
}
'
);
});
}
}
...
...
@@ -786,7 +786,7 @@ on(method: string, callback: CalleeCallback): void;
try
{
this
.
callee
.
on
(
method
,
funcCallBack
);
}
catch
(
error
)
{
console
.
log
(
'
Callee.on catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Callee.on catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}
}
...
...
@@ -825,7 +825,7 @@ off(method: string): void;
try
{
this
.
callee
.
off
(
method
);
}
catch
(
error
)
{
console
.
log
(
'
Callee.off catch error, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
Callee.off catch error, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
}
}
...
...
zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md
浏览文件 @
a466aedf
...
...
@@ -186,10 +186,10 @@ try {
WantAgent
.
getWantAgent
(
wantAgentInfo
).
then
((
data
)
=>
{
wantAgent
=
data
;
}).
catch
((
err
)
=>
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -280,7 +280,7 @@ function getWantAgentCallback(err, data) {
//getBundleName回调
function
getBundleNameCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getBundleName failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getBundleName failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getBundleName ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -288,13 +288,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
getBundleName
(
wantAgent
,
getBundleNameCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getBundleName failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getBundleName failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -391,16 +391,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
getBundleName
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
getBundleName ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getBundleName failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getBundleName failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
getBundleName failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getBundleName failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -492,7 +492,7 @@ function getWantAgentCallback(err, data) {
//getUid回调
function
getUidCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -500,13 +500,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
getUid
(
wantAgent
,
getUidCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -603,16 +603,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
getUid
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -704,7 +704,7 @@ function getWantAgentCallback(err, data) {
//getWant回调
function
getWantCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getWant failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWant failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getWant ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -712,13 +712,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
getWant
(
wantAgent
,
getWantCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWant failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWant failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -817,16 +817,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
getUid
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message}
}
'
);
}
```
...
...
@@ -917,7 +917,7 @@ function getWantAgentCallback(err, data) {
//cancel回调
function
cancelCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
cancel failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
cancel failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
cancel ok!
'
);
}
...
...
@@ -925,13 +925,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
cancel
(
wantAgent
,
cancelCallback
);
}
catch
(
err
)
{
console
.
error
(
'
cancel failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
cancel failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1028,16 +1028,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
cancel
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
cancel ok!
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
cancel failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
cancel failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
cancel failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
cancel failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1131,7 +1131,7 @@ function getWantAgentCallback(err, data) {
//trigger回调
function
triggerCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getUid ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -1139,13 +1139,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
trigger
(
wantAgent
,
triggerInfo
,
triggerCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getUid failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getUid failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1239,7 +1239,7 @@ function getWantAgentCallback(err, data) {
//equal回调
function
equalCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
equal failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
equal failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
equal ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -1247,13 +1247,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
equal
(
wantAgent1
,
wantAgent2
,
equalCallback
);
}
catch
(
err
)
{
console
.
error
(
'
equal failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
equal failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1353,16 +1353,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
equal
(
wantAgent1
,
wantAgent2
).
then
((
data
)
=>
{
console
.
info
(
'
equal ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
equal failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
equal failed! ${
err.code} ${err.message
}
'
);
})
}
catch
(
err
){
console
.
error
(
'
equal failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
equal failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1451,7 +1451,7 @@ function getWantAgentCallback(err, data) {
//getOperationTypeCallback回调
function
getOperationTypeCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
error
(
'
getOperationType failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getOperationType failed! ${
err.code} ${err.message
}
'
);
}
else
{
console
.
info
(
'
getOperationType ok! ${JSON.stringify(data)}
'
);
}
...
...
@@ -1459,13 +1459,13 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
getOperationTypeCallback
(
wantAgent
,
getOperationTypeCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getOperationTypeCallback failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getOperationTypeCallback failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
@@ -1560,16 +1560,16 @@ function getWantAgentCallback(err, data) {
WantAgent
.
getOperationType
(
wantAgent
).
then
((
data
)
=>
{
console
.
info
(
'
getOperationType ok! ${JSON.stringify(data)}
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
getOperationType failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getOperationType failed! ${
err.code} ${err.message
}
'
);
});
}
catch
(
err
){
console
.
error
(
'
getOperationType failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getOperationType failed! ${
err.code} ${err.message
}
'
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
)
{
console
.
error
(
'
getWantAgent failed! ${
JSON.stringify(err.code)} ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getWantAgent failed! ${
err.code} ${err.message
}
'
);
}
```
...
...
zh-cn/application-dev/reference/apis/js-apis-application-missionManager.md
浏览文件 @
a466aedf
...
...
@@ -170,7 +170,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<M
let
allMissions
=
missionManager
.
getMissionInfos
(
''
,
10
).
catch
(
function
(
err
){
console
.
log
(
err
);});
missionManager
.
getMissionInfo
(
''
,
allMissions
[
0
].
missionId
,
(
error
,
mission
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfo failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfo failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
...
...
@@ -247,7 +247,7 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback<Arr
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -319,7 +319,7 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback&
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -328,7 +328,7 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback&
missionManager
.
getMissionSnapShot
(
''
,
id
,
(
error
,
snapshot
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionSnapShot failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionSnapShot failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
bundleName = ${snapshot.ability.bundleName}
'
);
...
...
@@ -408,7 +408,7 @@ lockMission(missionId: number, callback: AsyncCallback<void>): void;
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -492,7 +492,7 @@ unlockMission(missionId: number, callback: AsyncCallback<void>): void;
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -580,7 +580,7 @@ clearMission(missionId: number, callback: AsyncCallback<void>): void;
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -716,7 +716,7 @@ moveMissionToFront(missionId: number, callback: AsyncCallback<void>): void
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -757,7 +757,7 @@ moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCall
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md
浏览文件 @
a466aedf
...
...
@@ -20,7 +20,7 @@ import appManager from '@ohos.app.ability.appManager';
function
getForegroundAppInfos
()
{
appManager
.
getForegroundApplications
((
error
,
data
)
=>
{
if
(
error
&&
error
.
code
)
{
console
.
log
(
'
getForegroundApplications failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
log
(
'
getForegroundApplications failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md
浏览文件 @
a466aedf
...
...
@@ -62,7 +62,7 @@ let bundleContext;
try
{
bundleContext
=
this
.
context
.
createBundleContext
(
'
com.example.test
'
);
}
catch
(
error
)
{
console
.
error
(
'
createBundleContext failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
createBundleContext failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
...
...
@@ -101,7 +101,7 @@ let moduleContext;
try
{
moduleContext
=
this
.
context
.
createModuleContext
(
'
entry
'
);
}
catch
(
error
)
{
console
.
error
(
'
createModuleContext failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
createModuleContext failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
...
...
@@ -141,7 +141,7 @@ let moduleContext;
try
{
moduleContext
=
this
.
context
.
createModuleContext
(
'
com.example.test
'
,
'
entry
'
);
}
catch
(
error
)
{
console
.
error
(
'
createModuleContext failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
createModuleContext failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
...
...
@@ -166,7 +166,7 @@ let applicationContext;
try
{
applicationContext
=
this
.
context
.
getApplicationContext
();
}
catch
(
error
)
{
console
.
error
(
'
getApplicationContext failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getApplicationContext failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
zh-cn/application-dev/reference/apis/js-apis-inner-application-continueCallback.md
浏览文件 @
a466aedf
...
...
@@ -38,7 +38,7 @@ Mission迁移完成后调用,返回迁移结果。
distributedMissionManager
.
continueMission
(
continueDeviceInfo
,
continueCallback
,
(
error
)
=>
{
if
(
error
&&
error
.
code
)
{
console
.
error
(
'
continueMission failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
continueMission failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
console
.
log
(
'
continueMission finished
'
);
});
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md
浏览文件 @
a466aedf
...
...
@@ -33,7 +33,7 @@
distributedMissionManager
.
continueMission
(
continueDeviceInfo
,
continueCallback
,
(
error
)
=>
{
if
(
error
&&
error
.
code
)
{
console
.
error
(
'
continueMission failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
continueMission failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
console
.
log
(
'
continueMission finished
'
);
});
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-errorObserver.md
浏览文件 @
a466aedf
...
...
@@ -30,7 +30,7 @@ let observer = {
try
{
errorManager
.
on
(
'
error
'
,
observer
);
}
catch
(
error
)
{
console
.
error
(
'
registerErrorObserver failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
registerErrorObserver failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
...
...
@@ -69,6 +69,6 @@ let observer = {
try
{
errorManager
.
on
(
'
error
'
,
observer
);
}
catch
(
error
)
{
console
.
error
(
'
registerErrorObserver failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
registerErrorObserver failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
}
```
zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md
浏览文件 @
a466aedf
...
...
@@ -33,7 +33,7 @@ let upperLimit = 1;
function
getExtensionInfos
()
{
abilityManager
.
getExtensionRunningInfos
(
upperLimit
,
(
error
,
data
)
=>
{
if
(
error
&&
error
.
code
)
{
console
.
error
(
'
getForegroundApplications failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getForegroundApplications failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md
浏览文件 @
a466aedf
...
...
@@ -25,7 +25,7 @@ try {
missionManager
.
getMissionInfo
(
''
,
1
,
(
error
,
data
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
getMissionInfo failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfo failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md
浏览文件 @
a466aedf
...
...
@@ -27,7 +27,7 @@
try
{
missionManager
.
getMissionInfos
(
''
,
10
,
(
error
,
missions
)
=>
{
if
(
error
.
code
)
{
console
.
error
(
'
getMissionInfos failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
console
.
log
(
'
size = ${missions.length}
'
);
...
...
@@ -36,7 +36,7 @@
missionManager
.
getMissionSnapShot
(
''
,
id
,
(
err
,
snapshot
)
=>
{
if
(
err
.
code
)
{
console
.
error
(
'
getMissionInfos failed, err.code: ${
JSON.stringify(err.code)}, err.message: ${JSON.stringify(err.message)
}
'
);
console
.
error
(
'
getMissionInfos failed, err.code: ${
err.code}, err.message: ${err.message
}
'
);
return
;
}
...
...
zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md
浏览文件 @
a466aedf
...
...
@@ -79,7 +79,7 @@ startAbility(want: Want, callback: AsyncCallback<void>): void;
this
.
context
.
startAbility
(
want
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -87,7 +87,7 @@ startAbility(want: Want, callback: AsyncCallback<void>): void;
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -158,11 +158,11 @@ startAbility(want: Want, options?: StartOptions): Promise\<void>;
})
.
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -225,7 +225,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void&
this
.
context
.
startAbility
(
want
,
options
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -233,7 +233,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void&
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -300,7 +300,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
this
.
context
.
startAbilityWithAccount
(
want
,
accountId
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -308,7 +308,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -379,7 +379,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
this
.
context
.
startAbilityWithAccount
(
want
,
accountId
,
options
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -387,7 +387,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -468,11 +468,11 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
})
.
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -523,7 +523,7 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
this
.
context
.
startServiceExtensionAbility
(
want
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
startServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -531,7 +531,7 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -591,11 +591,11 @@ startServiceExtensionAbility(want: Want): Promise\<void>;
})
.
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
startServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -652,7 +652,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
this
.
context
.
startServiceExtensionAbilityWithAccount
(
want
,
accountId
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
startServiceExtensionAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startServiceExtensionAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -660,7 +660,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -725,11 +725,11 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
})
.
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
startServiceExtensionAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startServiceExtensionAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -777,7 +777,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
this
.
context
.
stopServiceExtensionAbility
(
want
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
stopServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
stopServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -785,7 +785,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -842,11 +842,11 @@ stopServiceExtensionAbility(want: Want): Promise\<void>;
})
.
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
stopServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
stopServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -899,7 +899,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
this
.
context
.
stopServiceExtensionAbilityWithAccount
(
want
,
accountId
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
stopServiceExtensionAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code), error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
stopServiceExtensionAbilityWithAccount failed, error.code: ${
error.code, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -907,7 +907,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -969,11 +969,11 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
})
.
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
stopServiceExtensionAbilityWithAccount failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
stopServiceExtensionAbilityWithAccount failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1010,7 +1010,7 @@ terminateSelf(callback: AsyncCallback<void>): void;
this
.
context
.
terminateSelf
((
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
terminateSelf failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
terminateSelf failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -1053,7 +1053,7 @@ terminateSelf(): Promise<void>;
console
.
log
(
'
terminateSelf succeed
'
);
}).
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
terminateSelf failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
terminateSelf failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
```
...
...
@@ -1113,7 +1113,7 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
connection
=
this
.
context
.
connectServiceExtensionAbility
(
want
,
options
);
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1177,7 +1177,7 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
connection
=
this
.
context
.
connectServiceExtensionAbilityWithAccount
(
want
,
accountId
,
options
);
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1220,7 +1220,7 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback<
commRemote
=
null
;
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
disconnectServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
disconnectServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -1229,7 +1229,7 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback<
}
catch
(
paramError
)
{
commRemote
=
null
;
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1282,12 +1282,12 @@ disconnectServiceExtensionAbility(connection: number): Promise<void>;
.
catch
((
error
)
=>
{
commRemote
=
null
;
// 处理业务逻辑错误
console
.
error
(
'
disconnectServiceExtensionAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
disconnectServiceExtensionAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
commRemote
=
null
;
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1356,11 +1356,11 @@ startAbilityByCall(want: Want): Promise<Caller>;
console
.
log
(
'
startAbilityByCall succeed
'
);
}).
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
startAbilityByCall failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityByCall failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -1388,10 +1388,10 @@ startAbilityByCall(want: Want): Promise<Caller>;
console
.
log
(
'
startAbilityByCall succeed
'
);
}).
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
startAbilityByCall failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbilityByCall failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-inner-application-windowExtensionContext.md
浏览文件 @
a466aedf
...
...
@@ -58,7 +58,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void&
this
.
context
.
startAbility
(
want
,
options
,
(
error
)
=>
{
if
(
error
.
code
)
{
// 处理业务逻辑错误
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
return
;
}
// 执行正常业务
...
...
@@ -66,7 +66,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void&
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
...
...
@@ -110,10 +110,10 @@ startAbility(want: Want, options?: StartOptions): Promise\<void>
})
.
catch
((
error
)
=>
{
// 处理业务逻辑错误
console
.
error
(
'
startAbility failed, error.code: ${
JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)
}
'
);
console
.
error
(
'
startAbility failed, error.code: ${
error.code}, error.message: ${error.message
}
'
);
});
}
catch
(
paramError
)
{
// 处理入参错误异常
console
.
error
(
'
error.code: ${
JSON.stringify(paramError.code)}, error.message: ${JSON.stringify(paramError.message)
}
'
);
console
.
error
(
'
error.code: ${
paramError.code}, error.message: ${paramError.message
}
'
);
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.7/changelogs-ability.md
浏览文件 @
a466aedf
...
...
@@ -213,8 +213,8 @@ Caller相关接口使用RPC废弃的Sequenceable和MessageParcel对象,使用R
try
{
this
.
callee
.
on
(
method
,
funcCallBack
);
}
catch
(
error
)
{
console
.
log
(
'
Callee.on catch error, error.code:
'
+
JSON
.
stringify
(
error
.
code
)
+
'
error.message:
'
+
JSON
.
stringify
(
error
.
message
)
);
console
.
log
(
'
Callee.on catch error, error.code:
'
+
error
.
code
+
'
error.message:
'
+
error
.
message
);
}
}
}
...
...
@@ -257,8 +257,8 @@ Caller相关接口使用RPC废弃的Sequenceable和MessageParcel对象,使用R
try
{
this
.
callee
.
on
(
method
,
funcCallBack
);
}
catch
(
error
)
{
console
.
log
(
'
Callee.on catch error, error.code:
'
+
JSON
.
stringify
(
error
.
code
)
+
'
error.message:
'
+
JSON
.
stringify
(
error
.
message
)
);
console
.
log
(
'
Callee.on catch error, error.code:
'
+
error
.
code
+
'
error.message:
'
+
error
.
message
);
}
}
}
...
...
zh-cn/release-notes/changelogs/OpenHarmony_3.2.9.1/changelogs-wantAgent.md
浏览文件 @
a466aedf
...
...
@@ -71,7 +71,7 @@ function getWantAgentCallback(err, data) {
//getUid回调
function
triggerCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
'
getUid failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
)
);
console
.
info
(
'
getUid failed!
'
+
err
.
code
+
err
.
message
);
}
else
{
console
.
info
(
'
getUid ok!
'
+
JSON
.
stringify
(
data
));
}
...
...
@@ -79,12 +79,12 @@ function getWantAgentCallback(err, data) {
try
{
WantAgent
.
trigger
(
wantAgent
,
triggerInfo
,
triggerCallback
);
}
catch
(
err
)
{
console
.
info
(
'
getUid failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
)
);
console
.
info
(
'
getUid failed!
'
+
err
.
code
+
err
.
message
);
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
){
console
.
info
(
'
getWantAgent failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
)
);
console
.
info
(
'
getWantAgent failed!
'
+
err
.
code
+
err
.
message
);
}
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录