Skip to content

Commit

Permalink
fix(satori): catch prepare error in ws connection
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 20, 2024
1 parent 8f16bf5 commit 8737af9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/src/adapter.ts
Expand Up @@ -54,7 +54,14 @@ export namespace Adapter {

const reconnect = async (initial = false) => {
logger.debug('websocket client opening')
const socket = await this.prepare()
let socket: WebSocket
try {
socket = await this.prepare()
} catch (error) {
logger.warn(error)
return
}

// remove query args to protect privacy
const url = socket.url.replace(/\?.+/, '')

Expand Down

0 comments on commit 8737af9

Please sign in to comment.