opencode-feishu 0.7.3 → 0.7.4
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/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -99315,6 +99315,10 @@ function isModelError(errMsg, rawError) {
|
|
|
99315
99315
|
if (rawError && typeof rawError === "object") {
|
|
99316
99316
|
const e = rawError;
|
|
99317
99317
|
const fields = [e.type, e.name, e.message].filter(Boolean).map(String);
|
|
99318
|
+
if (e.data && typeof e.data === "object" && "message" in e.data) {
|
|
99319
|
+
const dataMsg = e.data.message;
|
|
99320
|
+
if (dataMsg) fields.push(String(dataMsg));
|
|
99321
|
+
}
|
|
99318
99322
|
return fields.some((f) => f.includes("ModelNotFound") || f.includes("ProviderModelNotFound"));
|
|
99319
99323
|
}
|
|
99320
99324
|
return false;
|
|
@@ -99353,11 +99357,17 @@ async function handleEvent(event, deps) {
|
|
|
99353
99357
|
errMsg = error;
|
|
99354
99358
|
} else if (error && typeof error === "object") {
|
|
99355
99359
|
const e = error;
|
|
99356
|
-
|
|
99360
|
+
const rawDataMsg = e.data && typeof e.data === "object" && "message" in e.data ? e.data.message : void 0;
|
|
99361
|
+
const dataMsg = rawDataMsg != null ? String(rawDataMsg) : void 0;
|
|
99362
|
+
errMsg = String(e.message ?? dataMsg ?? e.type ?? e.name ?? "An unexpected error occurred");
|
|
99357
99363
|
} else {
|
|
99358
99364
|
errMsg = String(error);
|
|
99359
99365
|
}
|
|
99360
|
-
const safeErrorFields = error && typeof error === "object" ? {
|
|
99366
|
+
const safeErrorFields = error && typeof error === "object" ? {
|
|
99367
|
+
type: error.type,
|
|
99368
|
+
name: error.name,
|
|
99369
|
+
dataMessage: error.data?.message
|
|
99370
|
+
} : { raw: String(error) };
|
|
99361
99371
|
deps.log("warn", "\u6536\u5230 session.error \u4E8B\u4EF6", {
|
|
99362
99372
|
sessionId,
|
|
99363
99373
|
error: safeErrorFields,
|