Skip to content

Commit

Permalink
remove dupe error event emits
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Sep 27, 2024
1 parent 0240ad6 commit bfbce5b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/web/websocket/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class WebSocket extends EventTarget {
onConnectionEstablished: (response, extensions) => this.#onConnectionEstablished(response, extensions),
onFail: (code, reason) => this.#onFail(code, reason),
onMessage: (opcode, data) => this.#onMessage(opcode, data),
onParserError: (err) => this.#onParserError(err),
onParserError: (err) => failWebsocketConnection(this.#handler, null, err.message),
onParserDrain: () => this.#onParserDrain(),
onSocketData: (chunk) => {
if (!this.#parser.write(chunk)) {
Expand Down Expand Up @@ -529,14 +529,6 @@ class WebSocket extends EventTarget {
})
}

#onParserError (err) {
const message = err.message

fireEvent('error', this, () => new ErrorEvent('error', { error: err, message }))

failWebsocketConnection(this.#handler, null, message)
}

#onParserDrain () {
this.#handler.socket.resume()
}
Expand Down

0 comments on commit bfbce5b

Please sign in to comment.