Skip to content

Commit b985574

Browse files
committed
log websocket connection close reason
1 parent a59fec9 commit b985574

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/client/realWsJsonClient.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ export default class RealWsJsonClient implements WsJsonClient {
172172
this.sendMessage(CONNECTION_REQUEST_MESSAGE);
173173
}
174174
socket.onopen = () => this.sendMessage(CONNECTION_REQUEST_MESSAGE);
175-
socket.onclose = () => debugLog("connection closed");
175+
socket.onclose = (event) =>
176+
debugLog("connection closed: ", event?.reason);
176177
socket.onmessage = ({ data }) =>
177178
this.onMessage(data as string, resolve, reject);
178179
});

src/example/testApp.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ async function run() {
176176
);
177177
const { client } = await authClient.authenticateWithRetry(token);
178178
const app = new TestApp(client);
179-
await app.getWatchlist(-3);
180-
await app.getWatchlist(126216147);
179+
await app.optionChainQuotes("ABNB");
181180
}
182181

183182
run().catch(console.error);

0 commit comments

Comments
 (0)