1# @ohos.bundle.launcherBundleManager (launcherBundleManager模块)(系统接口) 2 3本模块支持launcher应用所需的查询能力,支持[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)、[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)信息的查询。 4 5> **说明:** 6> 7> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 8> 9> 本模块为系统接口。 10 11## 导入模块 12 13```ts 14import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 15``` 16 17 18## launcherBundleManager.getLauncherAbilityInfo<sup>9+</sup> 19 20getLauncherAbilityInfo(bundleName: string, userId: number, callback: AsyncCallback\<Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\>\>) : void 21 22查询指定bundleName及用户的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)。 23 24**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 25 26**系统接口:** 此接口为系统接口。 27 28**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 29 30**参数:** 31 32| 参数名 | 类型 | 必填 | 说明 | 33| ---------- | ------ | ---- | -------------- | 34| bundleName | string | 是 | 应用Bundle名称。 | 35| userId | number | 是 | 被查询的用户id。| 36| callback | AsyncCallback\<Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\>\> | 是 | callback形式返回bundle包含的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)信息。 | 37 38**错误码:** 39 40以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 41 42| 错误码ID | 错误信息 | 43| -------- | ---------------------------------------- | 44| 201 | Permission denied. | 45| 202 | Permission denied, non-system app called system api. | 46| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 47| 801 | Capability not support. | 48| 17700001 | The specified bundle name is not found. | 49| 17700004 | The specified user ID is not found. | 50 51**示例:** 52 53```ts 54import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 55import { BusinessError } from '@ohos.base'; 56 57try { 58 launcherBundleManager.getLauncherAbilityInfo('com.example.demo', 100, 59 (errData: BusinessError, data: launcherBundleManager.LauncherAbilityInfo[]) => { 60 if (errData !== null) { 61 console.error(`errData is errCode:${errData.code} message:${errData.message}`); 62 } else { 63 console.log("data is " + JSON.stringify(data)); 64 } 65 }) 66} catch (errData) { 67 let code = (errData as BusinessError).code; 68 let message = (errData as BusinessError).message; 69 console.error(`errData is errCode:${code} message:${message}`); 70} 71``` 72 73## launcherBundleManager.getLauncherAbilityInfo<sup>9+</sup> 74 75getLauncherAbilityInfo(bundleName: string, userId: number) : Promise\<Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\>\> 76 77查询指定bundleName及用户的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)。 78 79**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 80 81**系统接口:** 此接口为系统接口。 82 83**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 84 85**参数:** 86 87| 参数名 | 类型 | 必填 | 说明 | 88| ---------- | ------ | ---- | -------------- | 89| bundleName | string | 是 | 应用Bundle名称。 | 90| userId | number | 是 | 被查询的用户id。 | 91 92**返回值:** 93 94| 类型 | 说明 | 95| ----------------------------- | -------------------------------------------------- | 96| Promise\<Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\>\> | Promise形式返回bundle包含的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)信息。 | 97 98**错误码:** 99 100以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 101 102| 错误码ID | 错误信息 | 103| -------- | ---------------------------------------- | 104| 201 | Permission denied. | 105| 202 | Permission denied, non-system app called system api. | 106| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 107| 801 | Capability not support. | 108| 17700001 | The specified bundle name is not found. | 109| 17700004 | The specified user ID is not found. | 110 111**示例:** 112 113```ts 114import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 115import { BusinessError } from '@ohos.base'; 116 117try { 118 launcherBundleManager.getLauncherAbilityInfo("com.example.demo", 100) 119 .then((data: launcherBundleManager.LauncherAbilityInfo[]) => { 120 console.log("data is " + JSON.stringify(data)); 121 }).catch ((errData: BusinessError) => { 122 console.error(`errData is errCode:${errData.code} message:${errData.message}`); 123 }) 124} catch (errData) { 125 let code = (errData as BusinessError).code; 126 let message = (errData as BusinessError).message; 127 console.error(`errData is errCode:${code} message:${message}`); 128} 129``` 130 131## launcherBundleManager.getLauncherAbilityInfoSync<sup>10+</sup> 132 133getLauncherAbilityInfoSync(bundleName: string, userId: number) : Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\> 134 135查询指定bundleName及用户的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)。 136 137**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 138 139**系统接口:** 此接口为系统接口。 140 141**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 142 143**参数:** 144 145| 参数名 | 类型 | 必填 | 说明 | 146| ---------- | ------ | ---- | -------------- | 147| bundleName | string | 是 | 应用Bundle名称。 | 148| userId | number | 是 | 被查询的用户id。 | 149 150**返回值:** 151 152| 类型 | 说明 | 153| ----------------------------- | -------------------------------------------------- | 154| Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\> | Array形式返回bundle包含的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)信息。 | 155 156**错误码:** 157 158以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 159 160| 错误码ID | 错误信息 | 161| -------- | ---------------------------------------- | 162| 201 | Permission denied. | 163| 202 | Permission denied, non-system app called system api. | 164| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 165| 801 | Capability not support. | 166| 17700001 | The specified bundle name is not found. | 167| 17700004 | The specified user ID is not found. | 168 169**示例:** 170 171```ts 172import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 173import { BusinessError } from '@ohos.base'; 174 175try { 176 let data = launcherBundleManager.getLauncherAbilityInfoSync("com.example.demo", 100); 177 console.log("data is " + JSON.stringify(data)); 178} catch (errData) { 179 let code = (errData as BusinessError).code; 180 let message = (errData as BusinessError).message; 181 console.error(`errData is errCode:${code} message:${message}`); 182} 183``` 184 185## launcherBundleManager.getAllLauncherAbilityInfo<sup>9+</sup> 186 187getAllLauncherAbilityInfo(userId: number, callback: AsyncCallback\<Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\>\>) : void 188 189查询指定用户下所有应用的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md) 190 191**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 192 193**系统接口:** 此接口为系统接口。 194 195**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 196 197**参数:** 198 199| 参数名 | 类型 | 必填 | 说明 | 200| ------ | ------ | ---- | -------------- | 201| userId | number | 是 | 被查询的用户id。 | 202| callback | AsyncCallback\<Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\>\> | 是 | callback形式返回指定用户下所有应用的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)。 | 203 204**错误码:** 205 206以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 207 208| 错误码ID | 错误信息 | 209| -------- | ---------------------------------------- | 210| 201 | Permission denied. | 211| 202 | Permission denied, non-system app called system api. | 212| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 213| 801 | Capability not support. | 214| 17700004 | The specified user ID is not found. | 215 216示例: 217 218```ts 219import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 220import { BusinessError } from '@ohos.base'; 221 222try { 223 launcherBundleManager.getAllLauncherAbilityInfo(100, 224 (errData: BusinessError, data: launcherBundleManager.LauncherAbilityInfo[]) => { 225 if (errData !== null) { 226 console.error(`errData is errCode:${errData.code} message:${errData.message}`); 227 } else { 228 console.log("data is " + JSON.stringify(data)); 229 } 230 }); 231} catch (errData) { 232 let code = (errData as BusinessError).code; 233 let message = (errData as BusinessError).message; 234 console.error(`errData is errCode:${code} message:${message}`); 235} 236``` 237## launcherBundleManager.getAllLauncherAbilityInfo<sup>9+</sup> 238 239getAllLauncherAbilityInfo(userId: number) : Promise\<Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\>\> 240 241查询指定用户下所有应用的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)。 242 243**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 244 245**系统接口:** 此接口为系统接口。 246 247**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 248 249**参数:** 250 251| 参数名 | 类型 | 必填 | 说明 | 252| ------ | ------ | ---- | -------------- | 253| userId | number | 是 | 被查询的用户id。 | 254 255**返回值:** 256 257| 类型 | 说明 | 258| ----------------------------- | ------------------------------------------------------ | 259| Promise\<Array\<[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)\>\> | Promise形式返回指定用户下所有应用的[LauncherAbilityInfo](js-apis-bundleManager-launcherAbilityInfo-sys.md)。 | 260 261**错误码:** 262 263以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 264 265| 错误码ID | 错误信息 | 266| -------- | ---------------------------------------- | 267| 201 | Permission denied. | 268| 202 | Permission denied, non-system app called system api. | 269| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 270| 801 | Capability not support. | 271| 17700004 | The specified user ID is not found. | 272 273**示例:** 274 275```ts 276import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 277import { BusinessError } from '@ohos.base'; 278 279try { 280 launcherBundleManager.getAllLauncherAbilityInfo(100) 281 .then((data: launcherBundleManager.LauncherAbilityInfo[]) => { 282 console.log("data is " + JSON.stringify(data)); 283 }).catch ((errData: BusinessError) => { 284 console.error(`errData is errCode:${errData.code} message:${errData.message}`); 285 }); 286} catch (errData) { 287 let code = (errData as BusinessError).code; 288 let message = (errData as BusinessError).message; 289 console.error(`errData is errCode:${code} message:${message}`); 290} 291``` 292 293## launcherBundleManager.getShortcutInfo<sup>9+</sup> 294 295getShortcutInfo(bundleName :string, callback: AsyncCallback\<Array\<[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)\>\>) : void 296 297查询当前用户下指定应用的[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)。 298 299**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 300 301**系统接口:** 此接口为系统接口。 302 303**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 304 305**参数:** 306 307| 参数名 | 类型 | 必填 | 说明 | 308| ---------- | ------ | ---- | -------------- | 309| bundleName | string | 是 | 应用Bundle名称。 | 310| callback | AsyncCallback\<Array\<[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)\>\> | 是 | callback形式返回当前用户下指定应用的[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)。 | 311 312**错误码:** 313 314以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 315 316| 错误码ID | 错误信息 | 317| -------- | ---------------------------------------- | 318| 201 | Permission denied. | 319| 202 | Permission denied, non-system app called system api. | 320| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 321| 801 | Capability not support. | 322| 17700001 | The specified bundle name is not found. | 323 324**示例:** 325 326```ts 327import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 328import { BusinessError } from '@ohos.base'; 329 330try { 331 launcherBundleManager.getShortcutInfo("com.example.demo", 332 (errData: BusinessError, data: launcherBundleManager.ShortcutInfo[]) => { 333 if (errData !== null) { 334 console.error(`errData is errCode:${errData.code} message:${errData.message}`); 335 } else { 336 console.log("data is " + JSON.stringify(data)); 337 } 338 }); 339} catch (errData) { 340 let code = (errData as BusinessError).code; 341 let message = (errData as BusinessError).message; 342 console.error(`errData is errCode:${code} message:${message}`); 343} 344``` 345 346## launcherBundleManager.getShortcutInfo<sup>9+</sup> 347 348getShortcutInfo(bundleName : string) : Promise\<Array\<[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)\>\> 349 350查询当前用户下指定应用的[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)。 351 352**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 353 354**系统接口:** 此接口为系统接口。 355 356**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 357 358**参数:** 359 360| 参数名 | 类型 | 必填 | 说明 | 361| ---------- | ------ | ---- | -------------- | 362| bundleName | string | 是 | 应用Bundle名称。 | 363 364**返回值:** 365 366| 类型 | 说明 | 367| ---------------------- | ----------------------------------------------- | 368| Promise\<Array\<[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)\>\> | Promise形式返回当前用户下指定应用的[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)。 | 369 370**错误码:** 371 372以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 373 374| 错误码ID | 错误信息 | 375| -------- | ---------------------------------------- | 376| 201 | Permission denied. | 377| 202 | Permission denied, non-system app called system api. | 378| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 379| 801 | Capability not support. | 380| 17700001 | The specified bundle name is not found. | 381 382**示例:** 383 384```ts 385import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 386import { BusinessError } from '@ohos.base'; 387 388try { 389 launcherBundleManager.getShortcutInfo("com.example.demo") 390 .then((data: launcherBundleManager.ShortcutInfo[]) => { 391 console.log("data is " + JSON.stringify(data)); 392 }).catch ((errData: BusinessError) => { 393 console.error(`errData is errCode:${errData.code} message:${errData.message}`); 394 }); 395} catch (errData) { 396 let code = (errData as BusinessError).code; 397 let message = (errData as BusinessError).message; 398 console.error(`errData is errCode:${code} message:${message}`); 399} 400``` 401 402## launcherBundleManager.getShortcutInfoSync<sup>10+</sup> 403 404getShortcutInfoSync(bundleName : string) : Array\<[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)\> 405 406查询当前用户下指定应用的[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)。 407 408**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 409 410**系统接口:** 此接口为系统接口。 411 412**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 413 414**参数:** 415 416| 参数名 | 类型 | 必填 | 说明 | 417| ---------- | ------ | ---- | -------------- | 418| bundleName | string | 是 | 应用Bundle名称。 | 419 420**返回值:** 421 422| 类型 | 说明 | 423| ---------------------- | ----------------------------------------------- | 424| Array\<[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)\> | Array形式返回当前用户下指定应用的[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)。 | 425 426**错误码:** 427 428以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 429 430| 错误码ID | 错误信息 | 431| -------- | ---------------------------------------- | 432| 201 | Permission denied. | 433| 202 | Permission denied, non-system app called system api. | 434| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 435| 801 | Capability not support. | 436| 17700001 | The specified bundle name is not found. | 437 438**示例:** 439 440```ts 441import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 442import { BusinessError } from '@ohos.base'; 443 444try { 445 let data = launcherBundleManager.getShortcutInfoSync("com.example.demo"); 446 console.log("data is " + JSON.stringify(data)); 447} catch (errData) { 448 let code = (errData as BusinessError).code; 449 let message = (errData as BusinessError).message; 450 console.error(`errData is errCode:${code} message:${message}`); 451} 452``` 453 454## launcherBundleManager.getShortcutInfoSync<sup>13+</sup> 455 456getShortcutInfoSync(bundleName: string, userId: number) : Array\<[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)\> 457 458查询指定用户下指定应用的[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)。 459 460**需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 461 462**系统接口:** 此接口为系统接口。 463 464**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 465 466**参数:** 467 468| 参数名 | 类型 | 必填 | 说明 | 469| ---------- | ------ | ---- | -------------- | 470| bundleName | string | 是 | 应用Bundle名称。 | 471| userId | number | 是 | 表示用户ID。 | 472 473**返回值:** 474 475| 类型 | 说明 | 476| ---------------------- | ----------------------------------------------- | 477| Array\<[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)\> | Array形式返回指定用户下指定应用的[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)。 | 478 479**错误码:** 480 481以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 482 483| 错误码ID | 错误信息 | 484| -------- | ---------------------------------------- | 485| 201 | Permission denied. | 486| 202 | Permission denied, non-system app called system api. | 487| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 488| 801 | Capability not support. | 489| 17700001 | The specified bundle name is not found. | 490| 17700004 | The specified user ID is not found. | 491 492**示例:** 493 494```ts 495import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 496import { BusinessError } from '@ohos.base'; 497 498try { 499 let data = launcherBundleManager.getShortcutInfoSync("com.example.demo", 100); 500 console.log("data is " + JSON.stringify(data)); 501} catch (errData) { 502 let code = (errData as BusinessError).code; 503 let message = (errData as BusinessError).message; 504 console.error(`errData is errCode:${code} message:${message}`); 505} 506``` 507 508## launcherBundleManager.startShortcut<sup>12+</sup> 509 510startShortcut(shortcutInfo: ShortcutInfo, options?: StartOptions): Promise\<void\>; 511 512拉起指定[ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md)中的ability。 513 514**需要权限:** ohos.permission.START_SHORTCUT 515 516**系统接口:** 此接口为系统接口。 517 518**系统能力:** SystemCapability.BundleManager.BundleFramework.Launcher 519 520**参数:** 521 522| 参数名 | 类型 | 必填 | 说明 | 523| ------------ | ------ | ---- | -------------- | 524| shortcutInfo | [ShortcutInfo](js-apis-bundleManager-shortcutInfo-sys.md) | 是 | 应用的快捷方式信息。 | 525| options | [StartOptions](js-apis-app-ability-startOptions-sys.md) | 否 | 启动参数选项,用于指定任务切到前台时的窗口模式,设备ID等。 | 526 527**错误码:** 528 529以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[ohos.bundle错误码](errorcode-bundle.md)。 530 531| 错误码ID | 错误信息 | 532| -------- | ---------------------------------------- | 533| 201 | Permission denied. | 534| 202 | Permission denied, non-system app called system api. | 535| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types.| 536| 801 | Capability not support. | 537| 17700065 | The ability specified by want in the ShortcutInfo struct cannot be started. | 538 539**示例:** 540 541```ts 542import launcherBundleManager from '@ohos.bundle.launcherBundleManager'; 543import { BusinessError } from '@ohos.base'; 544 545try { 546 let data : Array<launcherBundleManager.ShortcutInfo> = launcherBundleManager.getShortcutInfoSync("com.example.demo"); 547 console.log("data is " + JSON.stringify(data)); 548 if (data) { 549 try { 550 launcherBundleManager.startShortcut(data[0]) 551 .then(() => { 552 console.log("startShortcut success"); 553 }).catch ((err: BusinessError) => { 554 console.error(`errData is errCode:${err.code} message:${err.message}`); 555 }); 556 } catch (error) { 557 let code = (error as BusinessError).code; 558 let message = (error as BusinessError).message; 559 console.error(`error is errCode:${code} message:${message}`); 560 } 561 } 562} catch (errData) { 563 let code = (errData as BusinessError).code; 564 let message = (errData as BusinessError).message; 565 console.error(`errData is errCode:${code} message:${message}`); 566} 567``` 568