Skip to content

Commit

Permalink
specify websocket error as close reason when no message is available.
Browse files Browse the repository at this point in the history
fixes #411
  • Loading branch information
fiatjaf committed Jun 6, 2024
1 parent f8c3e20 commit 753ff32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion abstract-relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class AbstractRelay {
}

this.ws.onerror = ev => {
reject((ev as any).message)
reject((ev as any).message || 'websocket error')
if (this._connected) {
this._connected = false
this.connectionPromise = undefined
Expand Down

0 comments on commit 753ff32

Please sign in to comment.