fix(index.page): 优化WebSocket错误处理
Some checks failed
CI/CD Pipeline / playwright (push) Successful in 2m2s
/ playwright (push) Successful in 2m9s
/ build-and-test (push) Failing after 1m48s
CI/CD Pipeline / build-and-deploy (push) Successful in 3m30s

This commit is contained in:
严浩
2025-10-16 11:46:45 +08:00
parent 4fcd3bdcdb
commit f9748b78a3

View File

@@ -83,7 +83,10 @@ const connectWebSocket = async () => {
ws.value.onerror = (error) => {
wsLoading.value = false;
wsMessages.value.push(`⚠️ WebSocket连接错误: ${error} (${new Date().toLocaleTimeString()})`);
const errorMessage = error instanceof Error ? error.message : String(error);
wsMessages.value.push(
`⚠️ WebSocket连接错误: ${errorMessage} (${new Date().toLocaleTimeString()})`,
);
scrollToBottom();
};
} catch {