Commit 2de1ce8e authored by Chunchi Che's avatar Chunchi Che

alert error msg for websocket

parent 2c209e55
Pipeline #23225 passed with stages
in 11 minutes and 23 seconds
......@@ -17,6 +17,13 @@ export class WebSocketStream {
if (onWsOpen) {
this.ws.onopen = (e) => onWsOpen(this.ws, e);
}
this.ws.onerror = (e) => {
if (e instanceof ErrorEvent) {
alert(`websocket error: ${e.message}`);
} else {
alert(`websocket connect to ${ip} error`);
}
};
const ws = this.ws;
this.stream = new ReadableStream({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment