Reply to XMPP when outgoing webhook fails

This commit is contained in:
nioc 2019-11-24 16:39:57 +01:00
parent 1973c060aa
commit a99008b984
3 changed files with 5 additions and 0 deletions

View file

@ -46,6 +46,7 @@
"username": "bot@domain-xmpp.ltd",
"password": "botPass",
"resource": "botservice",
"errorReply": "Oops, something went wrong :(",
"rooms": [
{
"id": "roomname@conference.domain-xmpp.ltd",

View file

@ -135,6 +135,9 @@ module.exports = (logger, config) => {
case 'outgoing_webhook':
logger.debug(`Call outgoing webhook: ${xmppHook.args[0]}`)
outgoing(logger, config, this, from.toString(), replyTo.toString(), message, type, xmppHook.args[0])
.catch(() => {
this.send(replyTo.toString(), config.xmpp.errorReply, type)
})
break
default:
break

View file

@ -46,6 +46,7 @@
"username": "bot@domain-xmpp.ltd",
"password": "botPass",
"resource": "botservice",
"errorReply": "Oops, something went wrong :(",
"rooms": [
{
"id": "roomname@conference.domain-xmpp.ltd",