diff --git a/zh-cn/application-dev/reference/apis/js-apis-osAccount.md b/zh-cn/application-dev/reference/apis/js-apis-osAccount.md index be22f84244dfaaf28f19f430646edace95f6a50e..dc98c6587168bb5ea41179f726b6afb4b45ce2c1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-osAccount.md +++ b/zh-cn/application-dev/reference/apis/js-apis-osAccount.md @@ -90,7 +90,9 @@ activateOsAccount(localId: number, callback: AsyncCallback<void>): void } }); } catch (err) { - console.error(`activateOsAccount failed, code is ${err.code}, message is ${err.message}`); + let code = (err as BusinessError).code + let message = (err as BusinessError).message + console.error(`activateOsAccount failed, code is ${code}, message is ${message}`); } ``` @@ -178,7 +180,9 @@ checkMultiOsAccountEnabled(callback: AsyncCallback<boolean>): void } }); } catch (err) { - console.error(`checkMultiOsAccountEnabled failed, code is ${err.code}, message is ${err.message}`); + let code = (err as BusinessError).code + let message = (err as BusinessError).message + console.error(`checkMultiOsAccountEnabled failed, code is ${code}, message is ${message}`); } ``` @@ -214,7 +218,9 @@ checkMultiOsAccountEnabled(): Promise<boolean> console.error(`checkMultiOsAccountEnabled failed, code is ${err.code}, message is ${err.message}`); }); } catch (err) { - console.error(`checkMultiOsAccountEnabled failed, code is ${err.code}, message is ${err.message}`); + let code = (err as BusinessError).code + let message = (err as BusinessError).message + console.error(`checkMultiOsAccountEnabled failed, code is ${code}, message is ${message}`); } ```