提交 78add5f9 编写于 作者: Z zhoujun62

remove the senseless JSON.stringify

Signed-off-by: Nzhoujun62 <zhoujun62@huawei.com>
上级 3928cfe5
...@@ -79,7 +79,7 @@ try { ...@@ -79,7 +79,7 @@ try {
} }
}); });
} catch (paramError) { } 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 { ...@@ -135,7 +135,7 @@ try {
console.error('updateConfiguration fail, err: ${JSON.stringify(err)}'); console.error('updateConfiguration fail, err: ${JSON.stringify(err)}');
}); });
} catch (paramError) { } 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 { ...@@ -177,7 +177,7 @@ try {
} }
}); });
} catch (paramError) { } 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 { ...@@ -217,7 +217,7 @@ try {
console.error('getAbilityRunningInfos fail, err: ${JSON.stringify(err)}'); console.error('getAbilityRunningInfos fail, err: ${JSON.stringify(err)}');
}); });
} catch (paramError) { } 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 { ...@@ -262,7 +262,7 @@ try {
} }
}); });
} catch (paramError) { } 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 { ...@@ -310,7 +310,7 @@ try {
console.error('getExtensionRunningInfos fail, err: ${JSON.stringify(err)}'); console.error('getExtensionRunningInfos fail, err: ${JSON.stringify(err)}');
}); });
} catch (paramError) { } 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}');
} }
``` ```
......
...@@ -306,7 +306,7 @@ Obtains the information about a given mission. This API uses an asynchronous cal ...@@ -306,7 +306,7 @@ Obtains the information about a given mission. This API uses an asynchronous cal
missionManager.getMissionInfo('', testMissionId, (error, mission) => { missionManager.getMissionInfo('', testMissionId, (error, mission) => {
if (error) { 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 { } else {
console.log('mission.missionId = ${mission.missionId}'); console.log('mission.missionId = ${mission.missionId}');
console.log('mission.runningState = ${mission.runningState}'); console.log('mission.runningState = ${mission.runningState}');
...@@ -392,7 +392,7 @@ Obtains information about all missions. This API uses an asynchronous callback t ...@@ -392,7 +392,7 @@ Obtains information about all missions. This API uses an asynchronous callback t
try { try {
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error) { 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 { } else {
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
console.log('missions = ${JSON.stringify(missions)}'); console.log('missions = ${JSON.stringify(missions)}');
......
...@@ -33,7 +33,7 @@ import StartOptions from '@ohos.app.ability.StartOptions'; ...@@ -33,7 +33,7 @@ import StartOptions from '@ohos.app.ability.StartOptions';
try { try {
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
......
...@@ -375,10 +375,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -375,10 +375,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
console.log('Caller call() called'); console.log('Caller call() called');
}) })
.catch((callErr) => { .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) => { }).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 ...@@ -456,10 +456,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
data.readParcelable(retmsg); data.readParcelable(retmsg);
}) })
.catch((callErr) => { .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) => { }).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. ...@@ -498,10 +498,10 @@ Releases the caller interface of the target ability.
try { try {
caller.release(); caller.release();
} catch (releaseErr) { } 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) => { }).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 ...@@ -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}'); console.log(' Caller OnRelease CallBack is called ${str}');
}); });
} catch (error) { } 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) => { }).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 ...@@ -587,10 +587,10 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
console.log(' Caller OnRelease CallBack is called ${str}'); console.log(' Caller OnRelease CallBack is called ${str}');
}); });
} catch (error) { } 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) => { }).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). ...@@ -637,10 +637,10 @@ For other IDs, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
caller.on('release', onReleaseCallBack); caller.on('release', onReleaseCallBack);
caller.off('release', onReleaseCallBack); caller.off('release', onReleaseCallBack);
} catch (error) { } 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) => { }).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). ...@@ -686,10 +686,10 @@ For other IDs, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
caller.on('release', onReleaseCallBack); caller.on('release', onReleaseCallBack);
caller.off('release'); caller.off('release');
} catch (error) { } 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) => { }).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 ...@@ -759,7 +759,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
try { try {
this.callee.on(method, funcCallBack); this.callee.on(method, funcCallBack);
} catch (error) { } 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 ...@@ -798,7 +798,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
try { try {
this.callee.off(method); this.callee.off(method);
} catch (error) { } 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}');
} }
} }
} }
......
...@@ -186,10 +186,10 @@ try { ...@@ -186,10 +186,10 @@ try {
WantAgent.getWantAgent(wantAgentInfo).then((data) => { WantAgent.getWantAgent(wantAgentInfo).then((data) => {
wantAgent = data; wantAgent = data;
}).catch((err) => { }).catch((err) => {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getWantAgent failed! ${err.code} ${err.message}');
}); });
} catch (err) { } 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) { ...@@ -280,7 +280,7 @@ function getWantAgentCallback(err, data) {
// getBundleName callback // getBundleName callback
function getBundleNameCallback(err, data) { function getBundleNameCallback(err, data) {
if(err) { if(err) {
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getBundleName failed! ${err.code} ${err.message}');
} else { } else {
console.info('getBundleName ok! ${JSON.stringify(data)}'); console.info('getBundleName ok! ${JSON.stringify(data)}');
} }
...@@ -288,13 +288,13 @@ function getWantAgentCallback(err, data) { ...@@ -288,13 +288,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.getBundleName(wantAgent, getBundleNameCallback); WantAgent.getBundleName(wantAgent, getBundleNameCallback);
} catch(err) { } catch(err) {
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getBundleName failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -391,16 +391,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getBundleName(wantAgent).then((data)=>{ WantAgent.getBundleName(wantAgent).then((data)=>{
console.info('getBundleName ok! ${JSON.stringify(data)}'); console.info('getBundleName ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getBundleName failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getBundleName failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -492,7 +492,7 @@ function getWantAgentCallback(err, data) {
// getUid callback // getUid callback
function getUidCallback(err, data) { function getUidCallback(err, data) {
if(err) { if(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} else { } else {
console.info('getUid ok! ${JSON.stringify(data)}'); console.info('getUid ok! ${JSON.stringify(data)}');
} }
...@@ -500,13 +500,13 @@ function getWantAgentCallback(err, data) { ...@@ -500,13 +500,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.getUid(wantAgent, getUidCallback); WantAgent.getUid(wantAgent, getUidCallback);
} catch(err) { } catch(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -603,16 +603,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getUid(wantAgent).then((data)=>{ WantAgent.getUid(wantAgent).then((data)=>{
console.info('getUid ok! ${JSON.stringify(data)}'); console.info('getUid ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -704,7 +704,7 @@ function getWantAgentCallback(err, data) {
// getWant callback // getWant callback
function getWantCallback(err, data) { function getWantCallback(err, data) {
if(err) { if(err) {
console.error('getWant failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getWant failed! ${err.code} ${err.message}');
} else { } else {
console.info('getWant ok! ${JSON.stringify(data)}'); console.info('getWant ok! ${JSON.stringify(data)}');
} }
...@@ -712,13 +712,13 @@ function getWantAgentCallback(err, data) { ...@@ -712,13 +712,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.getWant(wantAgent, getWantCallback); WantAgent.getWant(wantAgent, getWantCallback);
} catch(err) { } catch(err) {
console.error('getWant failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getWant failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -817,16 +817,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getUid(wantAgent).then((data)=>{ WantAgent.getUid(wantAgent).then((data)=>{
console.info('getUid ok! ${JSON.stringify(data)}'); console.info('getUid ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -917,7 +917,7 @@ function getWantAgentCallback(err, data) {
// cancel callback // cancel callback
function cancelCallback(err, data) { function cancelCallback(err, data) {
if(err) { if(err) {
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('cancel failed! ${err.code} ${err.message}');
} else { } else {
console.info('cancel ok!'); console.info('cancel ok!');
} }
...@@ -925,13 +925,13 @@ function getWantAgentCallback(err, data) { ...@@ -925,13 +925,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.cancel(wantAgent, cancelCallback); WantAgent.cancel(wantAgent, cancelCallback);
} catch(err) { } catch(err) {
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('cancel failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1028,16 +1028,16 @@ function getWantAgentCallback(err, data) {
WantAgent.cancel(wantAgent).then((data)=>{ WantAgent.cancel(wantAgent).then((data)=>{
console.info('cancel ok!'); console.info('cancel ok!');
}).catch((err)=>{ }).catch((err)=>{
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('cancel failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('cancel failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1131,7 +1131,7 @@ function getWantAgentCallback(err, data) {
// trigger callback // trigger callback
function triggerCallback(err, data) { function triggerCallback(err, data) {
if(err) { if(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} else { } else {
console.info('getUid ok! ${JSON.stringify(data)}'); console.info('getUid ok! ${JSON.stringify(data)}');
} }
...@@ -1139,13 +1139,13 @@ function getWantAgentCallback(err, data) { ...@@ -1139,13 +1139,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.trigger(wantAgent, triggerInfo, triggerCallback); WantAgent.trigger(wantAgent, triggerInfo, triggerCallback);
} catch(err) { } catch(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1239,7 +1239,7 @@ function getWantAgentCallback(err, data) {
// equal callback // equal callback
function equalCallback(err, data) { function equalCallback(err, data) {
if(err) { if(err) {
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('equal failed! ${err.code} ${err.message}');
} else { } else {
console.info('equal ok! ${JSON.stringify(data)}'); console.info('equal ok! ${JSON.stringify(data)}');
} }
...@@ -1247,13 +1247,13 @@ function getWantAgentCallback(err, data) { ...@@ -1247,13 +1247,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.equal(wantAgent1,wantAgent2,equalCallback); WantAgent.equal(wantAgent1,wantAgent2,equalCallback);
} catch(err) { } catch(err) {
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('equal failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1353,16 +1353,16 @@ function getWantAgentCallback(err, data) {
WantAgent.equal(wantAgent1,wantAgent2).then((data)=>{ WantAgent.equal(wantAgent1,wantAgent2).then((data)=>{
console.info('equal ok! ${JSON.stringify(data)}'); console.info('equal ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('equal failed! ${err.code} ${err.message}');
}) })
} catch(err){ } catch(err){
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('equal failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1451,7 +1451,7 @@ function getWantAgentCallback(err, data) {
// getOperationTypeCallback callback // getOperationTypeCallback callback
function getOperationTypeCallback(err, data) { function getOperationTypeCallback(err, data) {
if(err) { if(err) {
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getOperationType failed! ${err.code} ${err.message}');
} else { } else {
console.info('getOperationType ok! ${JSON.stringify(data)}'); console.info('getOperationType ok! ${JSON.stringify(data)}');
} }
...@@ -1459,13 +1459,13 @@ function getWantAgentCallback(err, data) { ...@@ -1459,13 +1459,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.getOperationTypeCallback(wantAgent, getOperationTypeCallback); WantAgent.getOperationTypeCallback(wantAgent, getOperationTypeCallback);
} catch(err) { } catch(err) {
console.error('getOperationTypeCallback failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getOperationTypeCallback failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1560,16 +1560,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getOperationType(wantAgent).then((data)=>{ WantAgent.getOperationType(wantAgent).then((data)=>{
console.info('getOperationType ok! ${JSON.stringify(data)}'); console.info('getOperationType ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getOperationType failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getOperationType failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getWantAgent failed! ${err.code} ${err.message}');
} }
``` ```
......
...@@ -170,7 +170,7 @@ Obtains the information about a given mission. This API uses an asynchronous cal ...@@ -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);}); let allMissions=missionManager.getMissionInfos('',10).catch(function(err){console.log(err);});
missionManager.getMissionInfo('', allMissions[0].missionId, (error, mission) => { missionManager.getMissionInfo('', allMissions[0].missionId, (error, mission) => {
if (error.code) { 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; return;
} }
...@@ -247,7 +247,7 @@ Obtains information about all missions. This API uses an asynchronous callback t ...@@ -247,7 +247,7 @@ Obtains information about all missions. This API uses an asynchronous callback t
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -319,7 +319,7 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback ...@@ -319,7 +319,7 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -328,7 +328,7 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback ...@@ -328,7 +328,7 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback
missionManager.getMissionSnapShot('', id, (error, snapshot) => { missionManager.getMissionSnapShot('', id, (error, snapshot) => {
if (error.code) { 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; return;
} }
console.log('bundleName = ${snapshot.ability.bundleName}'); console.log('bundleName = ${snapshot.ability.bundleName}');
...@@ -408,7 +408,7 @@ Locks a given mission. This API uses an asynchronous callback to return the resu ...@@ -408,7 +408,7 @@ Locks a given mission. This API uses an asynchronous callback to return the resu
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -492,7 +492,7 @@ Unlocks a given mission. This API uses an asynchronous callback to return the re ...@@ -492,7 +492,7 @@ Unlocks a given mission. This API uses an asynchronous callback to return the re
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -580,7 +580,7 @@ Clears a given mission, regardless of whether it is locked. This API uses an asy ...@@ -580,7 +580,7 @@ Clears a given mission, regardless of whether it is locked. This API uses an asy
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -716,7 +716,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba ...@@ -716,7 +716,7 @@ Switches a given mission to the foreground. This API uses an asynchronous callba
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -757,7 +757,7 @@ Switches a given mission to the foreground, with the startup parameters for the ...@@ -757,7 +757,7 @@ Switches a given mission to the foreground, with the startup parameters for the
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
......
...@@ -20,7 +20,7 @@ import appManager from '@ohos.app.ability.appManager'; ...@@ -20,7 +20,7 @@ import appManager from '@ohos.app.ability.appManager';
function getForegroundAppInfos() { function getForegroundAppInfos() {
appManager.getForegroundApplications((error, data) => { appManager.getForegroundApplications((error, data) => {
if (error && error.code) { 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; return;
} }
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
......
...@@ -62,7 +62,7 @@ let bundleContext; ...@@ -62,7 +62,7 @@ let bundleContext;
try { try {
bundleContext = this.context.createBundleContext('com.example.test'); bundleContext = this.context.createBundleContext('com.example.test');
} catch (error) { } 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; ...@@ -101,7 +101,7 @@ let moduleContext;
try { try {
moduleContext = this.context.createModuleContext('entry'); moduleContext = this.context.createModuleContext('entry');
} catch (error) { } 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; ...@@ -141,7 +141,7 @@ let moduleContext;
try { try {
moduleContext = this.context.createModuleContext('com.example.test', 'entry'); moduleContext = this.context.createModuleContext('com.example.test', 'entry');
} catch (error) { } 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; ...@@ -166,6 +166,6 @@ let applicationContext;
try { try {
applicationContext = this.context.getApplicationContext(); applicationContext = this.context.getApplicationContext();
} catch (error) { } 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}');
} }
``` ```
...@@ -38,7 +38,7 @@ Called when the mission continuation is complete. ...@@ -38,7 +38,7 @@ Called when the mission continuation is complete.
distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => { distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
if (error && error.code) { 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'); console.log('continueMission finished');
}); });
......
...@@ -33,7 +33,7 @@ The **ContinueDeviceInfo** module defines the parameters required for initiating ...@@ -33,7 +33,7 @@ The **ContinueDeviceInfo** module defines the parameters required for initiating
distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => { distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
if (error && error.code) { 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'); console.log('continueMission finished');
}); });
......
...@@ -30,6 +30,6 @@ let observer = { ...@@ -30,6 +30,6 @@ let observer = {
try { try {
errorManager.on('error', observer); errorManager.on('error', observer);
} catch (error) { } 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}');
} }
``` ```
...@@ -33,7 +33,7 @@ let upperLimit = 1; ...@@ -33,7 +33,7 @@ let upperLimit = 1;
function getExtensionInfos() { function getExtensionInfos() {
abilityManager.getExtensionRunningInfos(upperLimit, (error, data) => { abilityManager.getExtensionRunningInfos(upperLimit, (error, data) => {
if (error && error.code) { 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; return;
} }
......
...@@ -25,7 +25,7 @@ try { ...@@ -25,7 +25,7 @@ try {
missionManager.getMissionInfo('', 1, (error, data) => { missionManager.getMissionInfo('', 1, (error, data) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
......
...@@ -27,7 +27,7 @@ The mission snapshot information can be obtained by using **getMissionSnapShot** ...@@ -27,7 +27,7 @@ The mission snapshot information can be obtained by using **getMissionSnapShot**
try { try {
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -36,7 +36,7 @@ The mission snapshot information can be obtained by using **getMissionSnapShot** ...@@ -36,7 +36,7 @@ The mission snapshot information can be obtained by using **getMissionSnapShot**
missionManager.getMissionSnapShot('', id, (err, snapshot) => { missionManager.getMissionSnapShot('', id, (err, snapshot) => {
if (err.code) { 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; return;
} }
......
...@@ -77,7 +77,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -77,7 +77,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
this.context.startAbility(want, (error) => { this.context.startAbility(want, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -85,7 +85,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -85,7 +85,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -155,11 +155,11 @@ Starts an ability. This API uses a promise to return the result. ...@@ -155,11 +155,11 @@ Starts an ability. This API uses a promise to return the result.
}) })
.catch((error) => { .catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -221,7 +221,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -221,7 +221,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
this.context.startAbility(want, options, (error) => { this.context.startAbility(want, options, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -229,7 +229,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -229,7 +229,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -295,7 +295,7 @@ Observe the following when using this API: ...@@ -295,7 +295,7 @@ Observe the following when using this API:
this.context.startAbilityWithAccount(want, accountId, (error) => { this.context.startAbilityWithAccount(want, accountId, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -303,7 +303,7 @@ Observe the following when using this API: ...@@ -303,7 +303,7 @@ Observe the following when using this API:
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -373,7 +373,7 @@ Observe the following when using this API: ...@@ -373,7 +373,7 @@ Observe the following when using this API:
this.context.startAbilityWithAccount(want, accountId, options, (error) => { this.context.startAbilityWithAccount(want, accountId, options, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -381,7 +381,7 @@ Observe the following when using this API: ...@@ -381,7 +381,7 @@ Observe the following when using this API:
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -461,11 +461,11 @@ Observe the following when using this API: ...@@ -461,11 +461,11 @@ Observe the following when using this API:
}) })
.catch((error) => { .catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -516,7 +516,7 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to ...@@ -516,7 +516,7 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to
this.context.startServiceExtensionAbility(want, (error) => { this.context.startServiceExtensionAbility(want, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -524,7 +524,7 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to ...@@ -524,7 +524,7 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -584,11 +584,11 @@ Starts a new ServiceExtensionAbility. This API uses a promise to return the resu ...@@ -584,11 +584,11 @@ Starts a new ServiceExtensionAbility. This API uses a promise to return the resu
}) })
.catch((error) => { .catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -645,7 +645,7 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use ...@@ -645,7 +645,7 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use
this.context.startServiceExtensionAbilityWithAccount(want, accountId, (error) => { this.context.startServiceExtensionAbilityWithAccount(want, accountId, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -653,7 +653,7 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use ...@@ -653,7 +653,7 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -718,11 +718,11 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use ...@@ -718,11 +718,11 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use
}) })
.catch((error) => { .catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -770,7 +770,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch ...@@ -770,7 +770,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch
this.context.stopServiceExtensionAbility(want, (error) => { this.context.stopServiceExtensionAbility(want, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -778,7 +778,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch ...@@ -778,7 +778,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -835,11 +835,11 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise ...@@ -835,11 +835,11 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise
}) })
.catch((error) => { .catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -892,7 +892,7 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec ...@@ -892,7 +892,7 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec
this.context.stopServiceExtensionAbilityWithAccount(want, accountId, (error) => { this.context.stopServiceExtensionAbilityWithAccount(want, accountId, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -900,7 +900,7 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec ...@@ -900,7 +900,7 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -962,11 +962,11 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec ...@@ -962,11 +962,11 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec
}) })
.catch((error) => { .catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -1003,7 +1003,7 @@ Terminates this ability. This API uses an asynchronous callback to return the re ...@@ -1003,7 +1003,7 @@ Terminates this ability. This API uses an asynchronous callback to return the re
this.context.terminateSelf((error) => { this.context.terminateSelf((error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -1046,7 +1046,7 @@ Terminates this ability. This API uses a promise to return the result. ...@@ -1046,7 +1046,7 @@ Terminates this ability. This API uses a promise to return the result.
console.log('terminateSelf succeed'); console.log('terminateSelf succeed');
}).catch((error) => { }).catch((error) => {
// Process service logic errors. // 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}');
}); });
``` ```
...@@ -1103,7 +1103,7 @@ Connects this ability to a ServiceAbility. ...@@ -1103,7 +1103,7 @@ Connects this ability to a ServiceAbility.
connection = this.context.connectServiceExtensionAbility(want, options); connection = this.context.connectServiceExtensionAbility(want, options);
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -1164,7 +1164,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect ...@@ -1164,7 +1164,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect
connection = this.context.connectServiceExtensionAbilityWithAccount(want, accountId, options); connection = this.context.connectServiceExtensionAbilityWithAccount(want, accountId, options);
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -1206,7 +1206,7 @@ Disconnects this ability from the ServiceAbility. This API uses an asynchronous ...@@ -1206,7 +1206,7 @@ Disconnects this ability from the ServiceAbility. This API uses an asynchronous
this.context.disconnectServiceExtensionAbility(connection, (error) => { this.context.disconnectServiceExtensionAbility(connection, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -1214,7 +1214,7 @@ Disconnects this ability from the ServiceAbility. This API uses an asynchronous ...@@ -1214,7 +1214,7 @@ Disconnects this ability from the ServiceAbility. This API uses an asynchronous
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -1265,11 +1265,11 @@ Disconnects this ability from the ServiceAbility. This API uses a promise to ret ...@@ -1265,11 +1265,11 @@ Disconnects this ability from the ServiceAbility. This API uses a promise to ret
}) })
.catch((error) => { .catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -1337,11 +1337,11 @@ Observe the following when using this API: ...@@ -1337,11 +1337,11 @@ Observe the following when using this API:
console.log('startAbilityByCall succeed'); console.log('startAbilityByCall succeed');
}).catch((error) => { }).catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -1369,10 +1369,10 @@ Observe the following when using this API: ...@@ -1369,10 +1369,10 @@ Observe the following when using this API:
console.log('startAbilityByCall succeed'); console.log('startAbilityByCall succeed');
}).catch((error) => { }).catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -58,7 +58,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -58,7 +58,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
this.context.startAbility(want, options, (error) => { this.context.startAbility(want, options, (error) => {
if (error.code) { if (error.code) {
// Process service logic errors. // 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; return;
} }
// Carry out normal service processing. // Carry out normal service processing.
...@@ -66,7 +66,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -66,7 +66,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
}); });
} catch (paramError) { } catch (paramError) {
// Process input parameter errors. // 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. ...@@ -110,10 +110,10 @@ Starts an ability. This API uses a promise to return the result.
}) })
.catch((error) => { .catch((error) => {
// Process service logic errors. // 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) { } catch (paramError) {
// Process input parameter errors. // 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}');
} }
``` ```
...@@ -31,7 +31,7 @@ try { ...@@ -31,7 +31,7 @@ try {
inputDevice.getDeviceIds((error, ids) => { inputDevice.getDeviceIds((error, ids) => {
if (error) { if (error) {
console.log(`Failed to get device list. 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; return;
} }
this.data = ids; this.data = ids;
...@@ -91,7 +91,7 @@ try { ...@@ -91,7 +91,7 @@ try {
inputDevice.getDeviceInfo(1, (error, inputDevice) => { inputDevice.getDeviceInfo(1, (error, inputDevice) => {
if (error) { if (error) {
console.log(`Failed to get device information. 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; return;
} }
console.log("The device name is: " + inputDevice.name); console.log("The device name is: " + inputDevice.name);
...@@ -421,7 +421,7 @@ try { ...@@ -421,7 +421,7 @@ try {
inputDevice.getKeyboardType(1, (error, number) => { inputDevice.getKeyboardType(1, (error, number) => {
if (error) { if (error) {
console.log(`Failed to get keyboardtype. 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; return;
} }
console.log("The keyboard type of the device is: " + number); console.log("The keyboard type of the device is: " + number);
......
...@@ -216,8 +216,8 @@ Code before the change: ...@@ -216,8 +216,8 @@ Code before the change:
try { try {
this.callee.on(method, funcCallBack); this.callee.on(method, funcCallBack);
} catch (error) { } catch (error) {
console.log('Callee.on catch error, error.code: ' + JSON.stringify(error.code) + console.log('Callee.on catch error, error.code: ' + error.code +
' error.message: ' + JSON.stringify(error.message)); ' error.message: ' + error.message);
} }
} }
} }
...@@ -260,8 +260,8 @@ Code after the change: ...@@ -260,8 +260,8 @@ Code after the change:
try { try {
this.callee.on(method, funcCallBack); this.callee.on(method, funcCallBack);
} catch (error) { } catch (error) {
console.log('Callee.on catch error, error.code: ' + JSON.stringify(error.code) + console.log('Callee.on catch error, error.code: ' + error.code +
' error.message: ' + JSON.stringify(error.message)); ' error.message: ' + error.message);
} }
} }
} }
......
...@@ -71,7 +71,7 @@ function getWantAgentCallback(err, data) { ...@@ -71,7 +71,7 @@ function getWantAgentCallback(err, data) {
// getUid callback // getUid callback
function triggerCallback(err, data) { function triggerCallback(err, data) {
if(err) { if(err) {
console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); console.info('getUid failed!' + err.code + err.message);
} else { } else {
console.info('getUid ok!' + JSON.stringify(data)); console.info('getUid ok!' + JSON.stringify(data));
} }
...@@ -79,12 +79,12 @@ function getWantAgentCallback(err, data) { ...@@ -79,12 +79,12 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.trigger(wantAgent, triggerInfo, triggerCallback); WantAgent.trigger(wantAgent, triggerInfo, triggerCallback);
} catch(err) { } catch(err) {
console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); console.info('getUid failed!' + err.code + err.message);
} }
} }
try{ try{
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err){ } catch(err){
console.info('getWantAgent failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); console.info('getWantAgent failed!' + err.code + err.message);
} }
``` ```
...@@ -79,7 +79,7 @@ try { ...@@ -79,7 +79,7 @@ try {
} }
}); });
} catch (paramError) { } 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 { ...@@ -135,7 +135,7 @@ try {
console.error('updateConfiguration fail, err: ${JSON.stringify(err)}'); console.error('updateConfiguration fail, err: ${JSON.stringify(err)}');
}); });
} catch (paramError) { } 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 { ...@@ -177,7 +177,7 @@ try {
} }
}); });
} catch (paramError) { } 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 { ...@@ -217,7 +217,7 @@ try {
console.error('getAbilityRunningInfos fail, err: ${JSON.stringify(err)}'); console.error('getAbilityRunningInfos fail, err: ${JSON.stringify(err)}');
}); });
} catch (paramError) { } 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 { ...@@ -262,7 +262,7 @@ try {
} }
}); });
} catch (paramError) { } 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 { ...@@ -310,7 +310,7 @@ try {
console.error('getExtensionRunningInfos fail, err: ${JSON.stringify(err)}'); console.error('getExtensionRunningInfos fail, err: ${JSON.stringify(err)}');
}); });
} catch (paramError) { } 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}');
} }
``` ```
......
...@@ -306,7 +306,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback&lt;M ...@@ -306,7 +306,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback&lt;M
missionManager.getMissionInfo('', testMissionId, (error, mission) => { missionManager.getMissionInfo('', testMissionId, (error, mission) => {
if (error) { 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 { } else {
console.log('mission.missionId = ${mission.missionId}'); console.log('mission.missionId = ${mission.missionId}');
console.log('mission.runningState = ${mission.runningState}'); console.log('mission.runningState = ${mission.runningState}');
...@@ -392,7 +392,7 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback&lt;Arr ...@@ -392,7 +392,7 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback&lt;Arr
try { try {
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error) { 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 { } else {
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
console.log('missions = ${JSON.stringify(missions)}'); console.log('missions = ${JSON.stringify(missions)}');
......
...@@ -33,7 +33,7 @@ import StartOptions from '@ohos.app.ability.StartOptions'; ...@@ -33,7 +33,7 @@ import StartOptions from '@ohos.app.ability.StartOptions';
try { try {
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
......
...@@ -402,10 +402,10 @@ call(method: string, data: rpc.Parcelable): Promise&lt;void&gt;; ...@@ -402,10 +402,10 @@ call(method: string, data: rpc.Parcelable): Promise&lt;void&gt;;
console.log('Caller call() called'); console.log('Caller call() called');
}) })
.catch((callErr) => { .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) => { }).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&lt;rpc.MessageSequ ...@@ -483,10 +483,10 @@ callWithResult(method: string, data: rpc.Parcelable): Promise&lt;rpc.MessageSequ
data.readParcelable(retmsg); data.readParcelable(retmsg);
}) })
.catch((callErr) => { .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) => { }).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; ...@@ -525,10 +525,10 @@ release(): void;
try { try {
caller.release(); caller.release();
} catch (releaseErr) { } 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) => { }).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; ...@@ -565,10 +565,10 @@ release(): void;
console.log(' Caller OnRelease CallBack is called ${str}'); console.log(' Caller OnRelease CallBack is called ${str}');
}); });
} catch (error) { } 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) => { }).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; ...@@ -614,10 +614,10 @@ release(): void;
console.log(' Caller OnRelease CallBack is called ${str}'); console.log(' Caller OnRelease CallBack is called ${str}');
}); });
} catch (error) { } 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) => { }).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; ...@@ -664,10 +664,10 @@ off(type: 'release', callback: OnReleaseCallback): void;
caller.on('release', onReleaseCallBack); caller.on('release', onReleaseCallBack);
caller.off('release', onReleaseCallBack); caller.off('release', onReleaseCallBack);
} catch (error) { } 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) => { }).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; ...@@ -713,10 +713,10 @@ off(type: 'release'): void;
caller.on('release', onReleaseCallBack); caller.on('release', onReleaseCallBack);
caller.off('release'); caller.off('release');
} catch (error) { } 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) => { }).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; ...@@ -786,7 +786,7 @@ on(method: string, callback: CalleeCallback): void;
try { try {
this.callee.on(method, funcCallBack); this.callee.on(method, funcCallBack);
} catch (error) { } 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; ...@@ -825,7 +825,7 @@ off(method: string): void;
try { try {
this.callee.off(method); this.callee.off(method);
} catch (error) { } 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}');
} }
} }
} }
......
...@@ -186,10 +186,10 @@ try { ...@@ -186,10 +186,10 @@ try {
WantAgent.getWantAgent(wantAgentInfo).then((data) => { WantAgent.getWantAgent(wantAgentInfo).then((data) => {
wantAgent = data; wantAgent = data;
}).catch((err) => { }).catch((err) => {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getWantAgent failed! ${err.code} ${err.message}');
}); });
} catch (err) { } 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) { ...@@ -280,7 +280,7 @@ function getWantAgentCallback(err, data) {
//getBundleName回调 //getBundleName回调
function getBundleNameCallback(err, data) { function getBundleNameCallback(err, data) {
if(err) { if(err) {
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getBundleName failed! ${err.code} ${err.message}');
} else { } else {
console.info('getBundleName ok! ${JSON.stringify(data)}'); console.info('getBundleName ok! ${JSON.stringify(data)}');
} }
...@@ -288,13 +288,13 @@ function getWantAgentCallback(err, data) { ...@@ -288,13 +288,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.getBundleName(wantAgent, getBundleNameCallback); WantAgent.getBundleName(wantAgent, getBundleNameCallback);
} catch(err) { } catch(err) {
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getBundleName failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -391,16 +391,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getBundleName(wantAgent).then((data)=>{ WantAgent.getBundleName(wantAgent).then((data)=>{
console.info('getBundleName ok! ${JSON.stringify(data)}'); console.info('getBundleName ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getBundleName failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('getBundleName failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getBundleName failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -492,7 +492,7 @@ function getWantAgentCallback(err, data) {
//getUid回调 //getUid回调
function getUidCallback(err, data) { function getUidCallback(err, data) {
if(err) { if(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} else { } else {
console.info('getUid ok! ${JSON.stringify(data)}'); console.info('getUid ok! ${JSON.stringify(data)}');
} }
...@@ -500,13 +500,13 @@ function getWantAgentCallback(err, data) { ...@@ -500,13 +500,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.getUid(wantAgent, getUidCallback); WantAgent.getUid(wantAgent, getUidCallback);
} catch(err) { } catch(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -603,16 +603,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getUid(wantAgent).then((data)=>{ WantAgent.getUid(wantAgent).then((data)=>{
console.info('getUid ok! ${JSON.stringify(data)}'); console.info('getUid ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -704,7 +704,7 @@ function getWantAgentCallback(err, data) {
//getWant回调 //getWant回调
function getWantCallback(err, data) { function getWantCallback(err, data) {
if(err) { if(err) {
console.error('getWant failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getWant failed! ${err.code} ${err.message}');
} else { } else {
console.info('getWant ok! ${JSON.stringify(data)}'); console.info('getWant ok! ${JSON.stringify(data)}');
} }
...@@ -712,13 +712,13 @@ function getWantAgentCallback(err, data) { ...@@ -712,13 +712,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.getWant(wantAgent, getWantCallback); WantAgent.getWant(wantAgent, getWantCallback);
} catch(err) { } catch(err) {
console.error('getWant failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getWant failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -817,16 +817,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getUid(wantAgent).then((data)=>{ WantAgent.getUid(wantAgent).then((data)=>{
console.info('getUid ok! ${JSON.stringify(data)}'); console.info('getUid ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -917,7 +917,7 @@ function getWantAgentCallback(err, data) {
//cancel回调 //cancel回调
function cancelCallback(err, data) { function cancelCallback(err, data) {
if(err) { if(err) {
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('cancel failed! ${err.code} ${err.message}');
} else { } else {
console.info('cancel ok!'); console.info('cancel ok!');
} }
...@@ -925,13 +925,13 @@ function getWantAgentCallback(err, data) { ...@@ -925,13 +925,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.cancel(wantAgent, cancelCallback); WantAgent.cancel(wantAgent, cancelCallback);
} catch(err) { } catch(err) {
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('cancel failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1028,16 +1028,16 @@ function getWantAgentCallback(err, data) {
WantAgent.cancel(wantAgent).then((data)=>{ WantAgent.cancel(wantAgent).then((data)=>{
console.info('cancel ok!'); console.info('cancel ok!');
}).catch((err)=>{ }).catch((err)=>{
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('cancel failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('cancel failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('cancel failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1131,7 +1131,7 @@ function getWantAgentCallback(err, data) {
//trigger回调 //trigger回调
function triggerCallback(err, data) { function triggerCallback(err, data) {
if(err) { if(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} else { } else {
console.info('getUid ok! ${JSON.stringify(data)}'); console.info('getUid ok! ${JSON.stringify(data)}');
} }
...@@ -1139,13 +1139,13 @@ function getWantAgentCallback(err, data) { ...@@ -1139,13 +1139,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.trigger(wantAgent, triggerInfo, triggerCallback); WantAgent.trigger(wantAgent, triggerInfo, triggerCallback);
} catch(err) { } catch(err) {
console.error('getUid failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getUid failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1239,7 +1239,7 @@ function getWantAgentCallback(err, data) {
//equal回调 //equal回调
function equalCallback(err, data) { function equalCallback(err, data) {
if(err) { if(err) {
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('equal failed! ${err.code} ${err.message}');
} else { } else {
console.info('equal ok! ${JSON.stringify(data)}'); console.info('equal ok! ${JSON.stringify(data)}');
} }
...@@ -1247,13 +1247,13 @@ function getWantAgentCallback(err, data) { ...@@ -1247,13 +1247,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.equal(wantAgent1,wantAgent2,equalCallback); WantAgent.equal(wantAgent1,wantAgent2,equalCallback);
} catch(err) { } catch(err) {
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('equal failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1353,16 +1353,16 @@ function getWantAgentCallback(err, data) {
WantAgent.equal(wantAgent1,wantAgent2).then((data)=>{ WantAgent.equal(wantAgent1,wantAgent2).then((data)=>{
console.info('equal ok! ${JSON.stringify(data)}'); console.info('equal ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('equal failed! ${err.code} ${err.message}');
}) })
} catch(err){ } catch(err){
console.error('equal failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('equal failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1451,7 +1451,7 @@ function getWantAgentCallback(err, data) {
//getOperationTypeCallback回调 //getOperationTypeCallback回调
function getOperationTypeCallback(err, data) { function getOperationTypeCallback(err, data) {
if(err) { if(err) {
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getOperationType failed! ${err.code} ${err.message}');
} else { } else {
console.info('getOperationType ok! ${JSON.stringify(data)}'); console.info('getOperationType ok! ${JSON.stringify(data)}');
} }
...@@ -1459,13 +1459,13 @@ function getWantAgentCallback(err, data) { ...@@ -1459,13 +1459,13 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.getOperationTypeCallback(wantAgent, getOperationTypeCallback); WantAgent.getOperationTypeCallback(wantAgent, getOperationTypeCallback);
} catch(err) { } catch(err) {
console.error('getOperationTypeCallback failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getOperationTypeCallback failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } 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) { ...@@ -1560,16 +1560,16 @@ function getWantAgentCallback(err, data) {
WantAgent.getOperationType(wantAgent).then((data)=>{ WantAgent.getOperationType(wantAgent).then((data)=>{
console.info('getOperationType ok! ${JSON.stringify(data)}'); console.info('getOperationType ok! ${JSON.stringify(data)}');
}).catch((err)=>{ }).catch((err)=>{
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getOperationType failed! ${err.code} ${err.message}');
}); });
} catch(err){ } catch(err){
console.error('getOperationType failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getOperationType failed! ${err.code} ${err.message}');
} }
} }
try { try {
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err) { } catch(err) {
console.error('getWantAgent failed! ${JSON.stringify(err.code)} ${JSON.stringify(err.message)}'); console.error('getWantAgent failed! ${err.code} ${err.message}');
} }
``` ```
......
...@@ -170,7 +170,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback&lt;M ...@@ -170,7 +170,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback&lt;M
let allMissions=missionManager.getMissionInfos('',10).catch(function(err){console.log(err);}); let allMissions=missionManager.getMissionInfos('',10).catch(function(err){console.log(err);});
missionManager.getMissionInfo('', allMissions[0].missionId, (error, mission) => { missionManager.getMissionInfo('', allMissions[0].missionId, (error, mission) => {
if (error.code) { 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; return;
} }
...@@ -247,7 +247,7 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback&lt;Arr ...@@ -247,7 +247,7 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback&lt;Arr
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -319,7 +319,7 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback& ...@@ -319,7 +319,7 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback&
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -328,7 +328,7 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback& ...@@ -328,7 +328,7 @@ getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback&
missionManager.getMissionSnapShot('', id, (error, snapshot) => { missionManager.getMissionSnapShot('', id, (error, snapshot) => {
if (error.code) { 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; return;
} }
console.log('bundleName = ${snapshot.ability.bundleName}'); console.log('bundleName = ${snapshot.ability.bundleName}');
...@@ -408,7 +408,7 @@ lockMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void; ...@@ -408,7 +408,7 @@ lockMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void;
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -492,7 +492,7 @@ unlockMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void; ...@@ -492,7 +492,7 @@ unlockMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void;
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -580,7 +580,7 @@ clearMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void; ...@@ -580,7 +580,7 @@ clearMission(missionId: number, callback: AsyncCallback&lt;void&gt;): void;
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -716,7 +716,7 @@ moveMissionToFront(missionId: number, callback: AsyncCallback&lt;void&gt;): void ...@@ -716,7 +716,7 @@ moveMissionToFront(missionId: number, callback: AsyncCallback&lt;void&gt;): void
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -757,7 +757,7 @@ moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCall ...@@ -757,7 +757,7 @@ moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCall
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
......
...@@ -20,7 +20,7 @@ import appManager from '@ohos.app.ability.appManager'; ...@@ -20,7 +20,7 @@ import appManager from '@ohos.app.ability.appManager';
function getForegroundAppInfos() { function getForegroundAppInfos() {
appManager.getForegroundApplications((error, data) => { appManager.getForegroundApplications((error, data) => {
if (error && error.code) { 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; return;
} }
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
......
...@@ -62,7 +62,7 @@ let bundleContext; ...@@ -62,7 +62,7 @@ let bundleContext;
try { try {
bundleContext = this.context.createBundleContext('com.example.test'); bundleContext = this.context.createBundleContext('com.example.test');
} catch (error) { } 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; ...@@ -101,7 +101,7 @@ let moduleContext;
try { try {
moduleContext = this.context.createModuleContext('entry'); moduleContext = this.context.createModuleContext('entry');
} catch (error) { } 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; ...@@ -141,7 +141,7 @@ let moduleContext;
try { try {
moduleContext = this.context.createModuleContext('com.example.test', 'entry'); moduleContext = this.context.createModuleContext('com.example.test', 'entry');
} catch (error) { } 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; ...@@ -166,7 +166,7 @@ let applicationContext;
try { try {
applicationContext = this.context.getApplicationContext(); applicationContext = this.context.getApplicationContext();
} catch (error) { } 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}');
} }
``` ```
...@@ -38,7 +38,7 @@ Mission迁移完成后调用,返回迁移结果。 ...@@ -38,7 +38,7 @@ Mission迁移完成后调用,返回迁移结果。
distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => { distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
if (error && error.code) { 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'); console.log('continueMission finished');
}); });
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => { distributedMissionManager.continueMission(continueDeviceInfo, continueCallback, (error) => {
if (error && error.code) { 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'); console.log('continueMission finished');
}); });
......
...@@ -30,7 +30,7 @@ let observer = { ...@@ -30,7 +30,7 @@ let observer = {
try { try {
errorManager.on('error', observer); errorManager.on('error', observer);
} catch (error) { } 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 = { ...@@ -69,6 +69,6 @@ let observer = {
try { try {
errorManager.on('error', observer); errorManager.on('error', observer);
} catch (error) { } 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}');
} }
``` ```
...@@ -33,7 +33,7 @@ let upperLimit = 1; ...@@ -33,7 +33,7 @@ let upperLimit = 1;
function getExtensionInfos() { function getExtensionInfos() {
abilityManager.getExtensionRunningInfos(upperLimit, (error, data) => { abilityManager.getExtensionRunningInfos(upperLimit, (error, data) => {
if (error && error.code) { 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; return;
} }
......
...@@ -25,7 +25,7 @@ try { ...@@ -25,7 +25,7 @@ try {
missionManager.getMissionInfo('', 1, (error, data) => { missionManager.getMissionInfo('', 1, (error, data) => {
if (error.code) { 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; return;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
try { try {
missionManager.getMissionInfos('', 10, (error, missions) => { missionManager.getMissionInfos('', 10, (error, missions) => {
if (error.code) { 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; return;
} }
console.log('size = ${missions.length}'); console.log('size = ${missions.length}');
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
missionManager.getMissionSnapShot('', id, (err, snapshot) => { missionManager.getMissionSnapShot('', id, (err, snapshot) => {
if (err.code) { 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; return;
} }
......
...@@ -79,7 +79,7 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void; ...@@ -79,7 +79,7 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
this.context.startAbility(want, (error) => { this.context.startAbility(want, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -87,7 +87,7 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void; ...@@ -87,7 +87,7 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
}); });
} catch (paramError) { } 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>; ...@@ -158,11 +158,11 @@ startAbility(want: Want, options?: StartOptions): Promise\<void>;
}) })
.catch((error) => { .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) { } 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&lt;void& ...@@ -225,7 +225,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&
this.context.startAbility(want, options, (error) => { this.context.startAbility(want, options, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -233,7 +233,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void& ...@@ -233,7 +233,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&
}); });
} catch (paramError) { } 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\< ...@@ -300,7 +300,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
this.context.startAbilityWithAccount(want, accountId, (error) => { this.context.startAbilityWithAccount(want, accountId, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -308,7 +308,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\< ...@@ -308,7 +308,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
}); });
} catch (paramError) { } 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 ...@@ -379,7 +379,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
this.context.startAbilityWithAccount(want, accountId, options, (error) => { this.context.startAbilityWithAccount(want, accountId, options, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -387,7 +387,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca ...@@ -387,7 +387,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
}); });
} catch (paramError) { } 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): ...@@ -468,11 +468,11 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
}) })
.catch((error) => { .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) { } 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; ...@@ -523,7 +523,7 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
this.context.startServiceExtensionAbility(want, (error) => { this.context.startServiceExtensionAbility(want, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -531,7 +531,7 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void; ...@@ -531,7 +531,7 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
}); });
} catch (paramError) { } 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>; ...@@ -591,11 +591,11 @@ startServiceExtensionAbility(want: Want): Promise\<void>;
}) })
.catch((error) => { .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) { } 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: ...@@ -652,7 +652,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
this.context.startServiceExtensionAbilityWithAccount(want, accountId, (error) => { this.context.startServiceExtensionAbilityWithAccount(want, accountId, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -660,7 +660,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: ...@@ -660,7 +660,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
}); });
} catch (paramError) { } 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\ ...@@ -725,11 +725,11 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
}) })
.catch((error) => { .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) { } 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; ...@@ -777,7 +777,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
this.context.stopServiceExtensionAbility(want, (error) => { this.context.stopServiceExtensionAbility(want, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -785,7 +785,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void; ...@@ -785,7 +785,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
}); });
} catch (paramError) { } 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>; ...@@ -842,11 +842,11 @@ stopServiceExtensionAbility(want: Want): Promise\<void>;
}) })
.catch((error) => { .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) { } 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: ...@@ -899,7 +899,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
this.context.stopServiceExtensionAbilityWithAccount(want, accountId, (error) => { this.context.stopServiceExtensionAbilityWithAccount(want, accountId, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -907,7 +907,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: ...@@ -907,7 +907,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
}); });
} catch (paramError) { } 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\< ...@@ -969,11 +969,11 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
}) })
.catch((error) => { .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) { } 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&lt;void&gt;): void; ...@@ -1010,7 +1010,7 @@ terminateSelf(callback: AsyncCallback&lt;void&gt;): void;
this.context.terminateSelf((error) => { this.context.terminateSelf((error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -1053,7 +1053,7 @@ terminateSelf(): Promise&lt;void&gt;; ...@@ -1053,7 +1053,7 @@ terminateSelf(): Promise&lt;void&gt;;
console.log('terminateSelf succeed'); console.log('terminateSelf succeed');
}).catch((error) => { }).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; ...@@ -1113,7 +1113,7 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
connection = this.context.connectServiceExtensionAbility(want, options); connection = this.context.connectServiceExtensionAbility(want, options);
} catch (paramError) { } 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 ...@@ -1177,7 +1177,7 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
connection = this.context.connectServiceExtensionAbilityWithAccount(want, accountId, options); connection = this.context.connectServiceExtensionAbilityWithAccount(want, accountId, options);
} catch (paramError) { } 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&lt; ...@@ -1220,7 +1220,7 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback&lt;
commRemote = null; commRemote = null;
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -1229,7 +1229,7 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback&lt; ...@@ -1229,7 +1229,7 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback&lt;
} catch (paramError) { } catch (paramError) {
commRemote = null; 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&lt;void&gt;; ...@@ -1282,12 +1282,12 @@ disconnectServiceExtensionAbility(connection: number): Promise&lt;void&gt;;
.catch((error) => { .catch((error) => {
commRemote = null; 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) { } catch (paramError) {
commRemote = null; 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&lt;Caller&gt;; ...@@ -1356,11 +1356,11 @@ startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
console.log('startAbilityByCall succeed'); console.log('startAbilityByCall succeed');
}).catch((error) => { }).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) { } 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&lt;Caller&gt;; ...@@ -1388,10 +1388,10 @@ startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
console.log('startAbilityByCall succeed'); console.log('startAbilityByCall succeed');
}).catch((error) => { }).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) { } 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
...@@ -58,7 +58,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void& ...@@ -58,7 +58,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&
this.context.startAbility(want, options, (error) => { this.context.startAbility(want, options, (error) => {
if (error.code) { 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; return;
} }
// 执行正常业务 // 执行正常业务
...@@ -66,7 +66,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void& ...@@ -66,7 +66,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&
}); });
} catch (paramError) { } 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> ...@@ -110,10 +110,10 @@ startAbility(want: Want, options?: StartOptions): Promise\<void>
}) })
.catch((error) => { .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) { } 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
...@@ -213,8 +213,8 @@ Caller相关接口使用RPC废弃的Sequenceable和MessageParcel对象,使用R ...@@ -213,8 +213,8 @@ Caller相关接口使用RPC废弃的Sequenceable和MessageParcel对象,使用R
try { try {
this.callee.on(method, funcCallBack); this.callee.on(method, funcCallBack);
} catch (error) { } catch (error) {
console.log('Callee.on catch error, error.code: ' + JSON.stringify(error.code) + console.log('Callee.on catch error, error.code: ' + error.code +
' error.message: ' + JSON.stringify(error.message)); ' error.message: ' + error.message);
} }
} }
} }
...@@ -257,8 +257,8 @@ Caller相关接口使用RPC废弃的Sequenceable和MessageParcel对象,使用R ...@@ -257,8 +257,8 @@ Caller相关接口使用RPC废弃的Sequenceable和MessageParcel对象,使用R
try { try {
this.callee.on(method, funcCallBack); this.callee.on(method, funcCallBack);
} catch (error) { } catch (error) {
console.log('Callee.on catch error, error.code: ' + JSON.stringify(error.code) + console.log('Callee.on catch error, error.code: ' + error.code +
' error.message: ' + JSON.stringify(error.message)); ' error.message: ' + error.message);
} }
} }
} }
......
...@@ -71,7 +71,7 @@ function getWantAgentCallback(err, data) { ...@@ -71,7 +71,7 @@ function getWantAgentCallback(err, data) {
//getUid回调 //getUid回调
function triggerCallback(err, data) { function triggerCallback(err, data) {
if(err) { if(err) {
console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); console.info('getUid failed!' + err.code + err.message);
} else { } else {
console.info('getUid ok!' + JSON.stringify(data)); console.info('getUid ok!' + JSON.stringify(data));
} }
...@@ -79,12 +79,12 @@ function getWantAgentCallback(err, data) { ...@@ -79,12 +79,12 @@ function getWantAgentCallback(err, data) {
try { try {
WantAgent.trigger(wantAgent, triggerInfo, triggerCallback); WantAgent.trigger(wantAgent, triggerInfo, triggerCallback);
} catch(err) { } catch(err) {
console.info('getUid failed!' + JSON.stringify(err.code) + JSON.stringify(err.message)); console.info('getUid failed!' + err.code + err.message);
} }
} }
try{ try{
WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback);
} catch(err){ } 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.
先完成此消息的编辑!
想要评论请 注册