mirror of
https://github.com/PR0M3TH3AN/bitgate.git
synced 2026-11-03 12:01:02 +00:00
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:
1 parent
adeba151b8
commit
729c0acc43
1 file changed
+4
-2
@@ -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 = () => {
|
||||
|
||||
Reference in new issue
Block a user