diff --git a/zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md b/zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md index 0c37541ad31999e725c5c81d9a617e9e764c3989..5153648ea2e9c2e95a2f21ab8ad7dd4a35c557ad 100644 --- a/zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md +++ b/zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.1/changelogs-dsoftbus.md @@ -130,16 +130,16 @@ ##### 适配指导 -新增支持异常处理的接口也会返回对应的错误码,以MessageParcel中的create接口为例,示例代码如下: +新增的接口以抛异常的方式返回错误码及对应的错误信息,以MessageParcel中的create接口为例,使用示例代码如下: ```js import rpc from '@ohos.rpc' try { - var data = rpc.MessageParcel.create(); - data.reclaim(); - } catch (error) { - console.info("create meassageParcel failed, errorCode = " + error.errCode); - console.info("create meassageParcel failed, errorMessage = " + error.errorMessage); - } + var data = rpc.MessageParcel.create(); + data.reclaim(); +} catch (error) { + console.info("create meassageParcel failed, errorCode = " + error.errCode); + console.info("create meassageParcel failed, errorMessage = " + error.errorMessage); +} ``` 更多接口的示例代码可参考[RPC通信API文档](../../../application-dev/reference/apis/js-apis-rpc.md)。 \ No newline at end of file