Skip to content

Commit 8d665bc

Browse files
author
funcodingdev
committed
fix: 添加备注
1 parent e86d55f commit 8d665bc

2 files changed

Lines changed: 22 additions & 8 deletions

File tree

nodes/WeCom/resources/wedoc/execute.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,12 +1349,25 @@ export async function executeWedoc(
13491349

13501350
const body: IDataObject = { docid, sheet_id, range };
13511351

1352-
response = await weComApiRequest.call(
1353-
this,
1354-
'POST',
1355-
'/cgi-bin/wedoc/spreadsheet/get_sheet_range_data',
1356-
body,
1357-
);
1352+
try {
1353+
response = await weComApiRequest.call(
1354+
this,
1355+
'POST',
1356+
'/cgi-bin/wedoc/spreadsheet/get_sheet_range_data',
1357+
body,
1358+
);
1359+
} catch (error) {
1360+
const err = error as Error;
1361+
// 错误码 608668 表示元数据未找到,通常是文档类型不匹配
1362+
if (err.message.includes('608668') || err.message.includes('meta is not found')) {
1363+
throw new NodeOperationError(
1364+
this.getNode(),
1365+
`获取表格数据失败:文档ID "${docid}" 可能不是普通在线表格(spreadsheet),或者文档不存在。此接口仅支持普通在线表格,不支持智能表格(smartsheet)。如果您的文档是智能表格,请使用"查询记录"操作来获取数据。`,
1366+
{ itemIndex: i },
1367+
);
1368+
}
1369+
throw error;
1370+
}
13581371
}
13591372
// 获取智能表格数据
13601373
else if (operation === 'querySmartsheetSheet') {

nodes/WeCom/resources/wedoc/getSheetData.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ export const getSheetDataDescription: INodeProperties[] = [
88
required: true,
99
displayOptions: { show: showOnly },
1010
default: '',
11-
description: '在线表格唯一标识',
12-
hint: '文档ID',
11+
description:
12+
'在线表格唯一标识。注意:此接口仅支持普通在线表格(spreadsheet),不支持智能表格(smartsheet)。如果您的文档是智能表格,请使用"查询记录"操作',
13+
hint: '在线表格ID',
1314
},
1415
{
1516
displayName: '工作表ID',

0 commit comments

Comments
 (0)