Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/spark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ async function chatSparkWs({
}
})

ws.on("error", (err) => {
reject(err)
ws.on("error", () => {
reject(new Error("星火 WebSocket 连接失败"))
})

ws.on("close", () => {
Expand Down Expand Up @@ -199,7 +199,7 @@ export async function chatSpark(opts: {
})
} catch (httpErr) {
if (APP_ID && API_KEY && API_SECRET && shouldFallbackToWs(httpErr)) {
console.warn("[Spark] X1 HTTP 失败自动回退 WebSocket v3.5:", httpErr)
console.warn(`[Spark] X1 HTTP 失败 (status: ${getHttpStatus(httpErr)}), 自动回退 WebSocket v3.5`)
try {
return await chatSparkWs(opts)
} catch {
Expand Down