mirror of
https://github.com/mattermost/focalboard.git
synced 2025-02-07 19:30:18 +02:00
Catch exception on failed WS command to avoid interface from breaking (#3858)
* Catch exception on failed WS command to avoid interface from breaking * Fix linter
This commit is contained in:
parent
8ded5838a8
commit
68f03d3fb1
@ -172,13 +172,17 @@ class WSClient {
|
||||
}
|
||||
|
||||
sendCommand(command: WSCommand): void {
|
||||
if (this.client !== null) {
|
||||
const {action, ...data} = command
|
||||
this.client.sendMessage(this.clientPrefix + action, data)
|
||||
return
|
||||
}
|
||||
try {
|
||||
if (this.client !== null) {
|
||||
const {action, ...data} = command
|
||||
this.client.sendMessage(this.clientPrefix + action, data)
|
||||
return
|
||||
}
|
||||
|
||||
this.ws?.send(JSON.stringify(command))
|
||||
this.ws?.send(JSON.stringify(command))
|
||||
} catch (e) {
|
||||
Utils.logError(`WSClient failed to send command ${command.action}: ${e}`)
|
||||
}
|
||||
}
|
||||
|
||||
sendAuthenticationCommand(token: string): void {
|
||||
|
Loading…
x
Reference in New Issue
Block a user