mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 14:22:40 +01:00
don't crash if fail to connect to websockets
This commit is contained in:
parent
582e1eb4f8
commit
f0755260a6
1 changed files with 10 additions and 4 deletions
|
@ -208,10 +208,16 @@ if (supportsWebSockets) {
|
|||
var path = srvModel.serverUrl + "/i/" + srvModel.invoiceId + "/status/ws";
|
||||
path = path.replace("https://", "wss://");
|
||||
path = path.replace("http://", "ws://");
|
||||
var socket = new WebSocket(path);
|
||||
socket.onmessage = function (e) {
|
||||
fetchStatus();
|
||||
};
|
||||
try {
|
||||
var socket = new WebSocket(path);
|
||||
socket.onmessage = function (e) {
|
||||
fetchStatus();
|
||||
};
|
||||
}
|
||||
catch
|
||||
{
|
||||
console.error("Error while connecting to websocket for invoice notifictions");
|
||||
}
|
||||
}
|
||||
|
||||
var watcher = setInterval(function () {
|
||||
|
|
Loading…
Add table
Reference in a new issue