fix(runtime): correct the socket error handler's type

A WebSocket error handler receives an Event, not an Error, so reading
.message off it was wrong. It only surfaced on a cold checkout — with built
declarations present, the inference happened to resolve differently, which is
why the previous commit passed locally and would have failed CI.
This commit is contained in:
thePR0M3TH3AN committed 2026-08-09 20:00:32 -04:00
1 parent adeba151b8
commit 729c0acc43
1 file changed
+4 -2
+4 -2
View File
@@ -172,8 +172,10 @@ export function createRelayTransport(urls, options = {}) {
}
};
socket.onerror = (error) => {
diagnostic("relay socket error", { url, error: String(error?.message ?? error) });
socket.onerror = (/** @type {any} */ event) => {
// A socket error handler receives an Event, not an Error: the useful
// detail (if any) hangs off it rather than being the argument itself.
diagnostic("relay socket error", { url, error: String(event?.message ?? event?.type ?? event) });
};
socket.onclose = () => {