mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 05:05:53 +00:00
Don't crash if bridges are offline
Fixes https://github.com/turt2live/matrix-dimension/issues/131
This commit is contained in:
parent
8cd5067e73
commit
266cf8c0d8
@ -140,6 +140,7 @@ export class GitterBridge {
|
||||
qs: qs,
|
||||
json: body,
|
||||
}, (err, res, _body) => {
|
||||
try {
|
||||
if (err) {
|
||||
LogService.error("GitterBridge", "Error calling " + url);
|
||||
LogService.error("GitterBridge", err);
|
||||
@ -156,6 +157,10 @@ export class GitterBridge {
|
||||
if (typeof (res.body) === "string") res.body = JSON.parse(res.body);
|
||||
resolve(res.body);
|
||||
}
|
||||
} catch (e) {
|
||||
LogService.error("GitterBridge", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -173,6 +178,7 @@ export class GitterBridge {
|
||||
qs: qs,
|
||||
json: body,
|
||||
}, (err, res, _body) => {
|
||||
try {
|
||||
if (err) {
|
||||
LogService.error("GitterBridge", "Error calling" + url);
|
||||
LogService.error("GitterBridge", err);
|
||||
@ -189,6 +195,10 @@ export class GitterBridge {
|
||||
if (typeof (res.body) === "string") res.body = JSON.parse(res.body);
|
||||
resolve(res.body);
|
||||
}
|
||||
} catch (e) {
|
||||
LogService.error("GitterBridge", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -281,6 +281,7 @@ export class IrcBridge {
|
||||
qs: qs,
|
||||
json: body,
|
||||
}, (err, res, _body) => {
|
||||
try {
|
||||
if (err) {
|
||||
LogService.error("IrcBridge", "Error calling " + url);
|
||||
LogService.error("IrcBridge", err);
|
||||
@ -296,6 +297,10 @@ export class IrcBridge {
|
||||
if (typeof (res.body) === "string") res.body = JSON.parse(res.body);
|
||||
resolve(res.body);
|
||||
}
|
||||
} catch (e) {
|
||||
LogService.error("IrcBridge", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -313,6 +318,7 @@ export class IrcBridge {
|
||||
qs: qs,
|
||||
json: body,
|
||||
}, (err, res, _body) => {
|
||||
try {
|
||||
if (err) {
|
||||
LogService.error("IrcBridge", "Error calling" + url);
|
||||
LogService.error("IrcBridge", err);
|
||||
@ -328,6 +334,10 @@ export class IrcBridge {
|
||||
if (typeof (res.body) === "string") res.body = JSON.parse(res.body);
|
||||
resolve(res.body);
|
||||
}
|
||||
} catch (e) {
|
||||
LogService.error("IrcBridge", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -257,6 +257,7 @@ export class SlackBridge {
|
||||
qs: qs,
|
||||
json: body,
|
||||
}, (err, res, _body) => {
|
||||
try {
|
||||
if (err) {
|
||||
LogService.error("SlackBridge", "Error calling " + url);
|
||||
LogService.error("SlackBridge", err);
|
||||
@ -273,6 +274,10 @@ export class SlackBridge {
|
||||
if (typeof (res.body) === "string") res.body = JSON.parse(res.body);
|
||||
resolve(res.body);
|
||||
}
|
||||
} catch (e) {
|
||||
LogService.error("SlackBridge", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -290,6 +295,7 @@ export class SlackBridge {
|
||||
qs: qs,
|
||||
json: body,
|
||||
}, (err, res, _body) => {
|
||||
try {
|
||||
if (err) {
|
||||
LogService.error("SlackBridge", "Error calling" + url);
|
||||
LogService.error("SlackBridge", err);
|
||||
@ -306,6 +312,10 @@ export class SlackBridge {
|
||||
if (typeof (res.body) === "string") res.body = JSON.parse(res.body);
|
||||
resolve(res.body);
|
||||
}
|
||||
} catch (e) {
|
||||
LogService.error("SlackBridge", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -209,6 +209,7 @@ export class TelegramBridge {
|
||||
"Authorization": `Bearer ${bridge.sharedSecret}`,
|
||||
},
|
||||
}, (err, res, _body) => {
|
||||
try {
|
||||
if (err) {
|
||||
LogService.error("TelegramBridge", "Error calling" + url);
|
||||
LogService.error("TelegramBridge", err);
|
||||
@ -225,6 +226,10 @@ export class TelegramBridge {
|
||||
if (typeof (res.body) === "string") res.body = JSON.parse(res.body);
|
||||
resolve(res.body);
|
||||
}
|
||||
} catch (e) {
|
||||
LogService.error("TelegramBridge", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ export class WebhooksBridge {
|
||||
qs: qs,
|
||||
json: body,
|
||||
}, (err, res, _body) => {
|
||||
try {
|
||||
if (err) {
|
||||
LogService.error("WebhooksBridge", "Error calling" + url);
|
||||
LogService.error("WebhooksBridge", err);
|
||||
@ -93,6 +94,10 @@ export class WebhooksBridge {
|
||||
if (typeof (res.body) === "string") res.body = JSON.parse(res.body);
|
||||
resolve(res.body);
|
||||
}
|
||||
} catch (e) {
|
||||
LogService.error("WebhooksBridge", e);
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user