webchat: show real ws errors

This commit is contained in:
Peter Steinberger
2025-12-10 01:27:47 +00:00
parent 00ace3bb63
commit 49e70746f0
5 changed files with 97 additions and 3 deletions

View File

@@ -7,6 +7,8 @@ if (!globalThis.process) {
globalThis.process = { env: {} };
}
import { formatError } from "./format-error.js";
const logStatus = (msg) => {
try {
console.log(msg);
@@ -331,7 +333,7 @@ const startChat = async () => {
};
startChat().catch((err) => {
const msg = err?.stack || err?.message || String(err);
const msg = formatError(err);
logStatus(`boot failed: ${msg}`);
document.body.dataset.webchatError = "1";
ensureErrorStyles();