claw-subagent-service 0.0.106 → 0.0.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -392,10 +392,14 @@ class OpenClawClient {
|
|
|
392
392
|
// 打印详细错误响应
|
|
393
393
|
if (err.response) {
|
|
394
394
|
this.log?.error(`[OpenClawClient] 错误状态码: ${err.response.status}`);
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
this.log?.error(`[OpenClawClient]
|
|
395
|
+
// 安全地提取错误信息
|
|
396
|
+
const errorData = err.response.data;
|
|
397
|
+
if (typeof errorData === 'string') {
|
|
398
|
+
this.log?.error(`[OpenClawClient] 错误响应: ${errorData}`);
|
|
399
|
+
} else if (errorData && typeof errorData === 'object') {
|
|
400
|
+
// 提取常见错误字段
|
|
401
|
+
const errorMsg = errorData.error?.message || errorData.message || errorData.error || JSON.stringify(errorData);
|
|
402
|
+
this.log?.error(`[OpenClawClient] 错误响应: ${errorMsg}`);
|
|
399
403
|
}
|
|
400
404
|
}
|
|
401
405
|
}
|