diff --git a/zh-cn/application-dev/reference/apis/js-apis-convertxml.md b/zh-cn/application-dev/reference/apis/js-apis-convertxml.md
index d805a588e1c387868121d14ec9443435236ec785..fccd142de86dfb397585557c8a9c3ed6ff01af02 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-convertxml.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-convertxml.md
@@ -47,21 +47,27 @@ convertToJSObject(xml: string, options?: ConvertOptions) : Object
**示例:**
```js
-let xml =
- '' +
- '' +
- ' Happy' +
- ' Work' +
- ' Play' +
- '';
-let conv = new convertxml.ConvertXML()
-let options = {trim : false, declarationKey:"_declaration",
- instructionKey : "_instruction", attributesKey : "_attributes",
- textKey : "_text", cdataKey:"_cdata", doctypeKey : "_doctype",
- commentKey : "_comment", parentKey : "_parent", typeKey : "_type",
- nameKey : "_name", elementsKey : "_elements"}
-let result = JSON.stringify(conv.convertToJSObject(xml, options));
-console.log(result);
+try {
+ let xml =
+ '' +
+ '' +
+ ' Happy' +
+ ' Work' +
+ ' Play' +
+ '';
+ let conv = new convertxml.ConvertXML()
+ let options = {
+ trim: false, declarationKey: "_declaration",
+ instructionKey: "_instruction", attributesKey: "_attributes",
+ textKey: "_text", cdataKey: "_cdata", doctypeKey: "_doctype",
+ commentKey: "_comment", parentKey: "_parent", typeKey: "_type",
+ nameKey: "_name", elementsKey: "_elements"
+ }
+ let result = JSON.stringify(conv.convertToJSObject(xml, options));
+ console.log(result);
+} catch (e) {
+ console.log(e.toString());
+}
// 输出(宽泛型)
// {"_declaration":{"_attributes":{"version":"1.0","encoding":"utf-8"}},"_elements":[{"_type":"element","_name":"note","_attributes":{"importance":"high","logged":"true"},"_elements":[{"_type":"element","_name":"title","_elements":[{"_type":"text","_text":"Happy"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Work"}]},{"_type":"element","_name":"todo","_elements":[{"_type":"text","_text":"Play"}]}]}]}
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-util.md b/zh-cn/application-dev/reference/apis/js-apis-util.md
index c50d6b23af161c2bbd9c58dc9e04a9b0fdbaea17..02c2185ccd74318283ba3286592c5a02dda84e7c 100755
--- a/zh-cn/application-dev/reference/apis/js-apis-util.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-util.md
@@ -26,7 +26,7 @@ format(format: string, ...args: Object[]): string
| 参数名 | 类型 | 必填 | 说明 |
| ------- | -------- | ---- | -------------- |
| format | string | 是 | 式样化字符串。 |
-| ...args | Object[] | 否 | 替换式样化字符串通配符的数据。 |
+| ...args | Object[] | 否 | 替换式样化字符串通配符的数据,此参数缺失时,默认返回第一个参数。 |
**返回值:**
@@ -69,6 +69,20 @@ let result = util.errnoToString(errnum);
console.log("result = " + result);
```
+**部分错误码及信息示例:**
+
+| 错误码 | 信息 |
+| ------ | -------------------------------- |
+| -1 | operation not permitted |
+| -2 | no such file or directory |
+| -3 | no such process |
+| -4 | interrupted system call |
+| -5 | i/o error |
+| -11 | resource temporarily unavailable |
+| -12 | not enough memory |
+| -13 | permission denied |
+| -100 | network is down |
+
## util.callbackWrapper
callbackWrapper(original: Function): (err: Object, value: Object )=>void
@@ -126,17 +140,23 @@ promisify(original: (err: Object, value: Object) => void): Function
**示例:**
```js
- function aysnFun(str1, str2) {
- if (typeof str1 === 'object' && typeof str2 === 'object') {
- return str2
- } else {
- return str1
- }
- }
- let newPromiseObj = util.promisify(aysnFun);
- newPromiseObj({ err: "type error" }, {value:'HelloWorld'}).then(res => {
- console.log(res);
- })
+function fun(num, callback) {
+ if (typeof num === 'number') {
+ callback(null, num + 3);
+ } else {
+ callback("type err");
+ }
+}
+
+const addCall = util.promisify(fun);
+(async () => {
+ try {
+ let res = await addCall(2);
+ console.log(res);
+ } catch (err) {
+ console.log(err);
+ }
+})();
```
## util.randomUUID9+
@@ -243,7 +263,7 @@ printf(format: string, ...args: Object[]): string
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| format | string | 是 | 式样化字符串。 |
-| ...args | Object[] | 否 | 替换式样化字符串通配符的数据。 |
+| ...args | Object[] | 否 | 替换式样化字符串通配符的数据,此参数缺失时,默认返回第一个参数。 |
**返回值:**