diff --git a/docs/xmpp-bot.service b/docs/xmpp-bot.service index 99f675d..ca0b845 100644 --- a/docs/xmpp-bot.service +++ b/docs/xmpp-bot.service @@ -5,7 +5,7 @@ After=network.target [Service] User=xmpp-bot -WorkingDirectory=/usr/local/bin/xmpp-bot/lib/ +WorkingDirectory=/usr/local/bin/xmpp-bot/ ExecStart=/usr/bin/node /usr/local/bin/xmpp-bot/lib/server.js Restart=on-failure RestartSec=1000ms diff --git a/lib/config/config.json.dist b/lib/config/config.json.dist index 8fe638e..07fcf0f 100644 --- a/lib/config/config.json.dist +++ b/lib/config/config.json.dist @@ -45,6 +45,7 @@ "domain": "domain-xmpp.ltd", "username": "bot@domain-xmpp.ltd", "password": "botPass", + "resource": "botservice", "rooms": [ { "id": "roomname@conference.domain-xmpp.ltd", diff --git a/lib/error/index.js b/lib/error/index.js index 474dc32..74030d0 100644 --- a/lib/error/index.js +++ b/lib/error/index.js @@ -15,7 +15,9 @@ module.exports = (logger, xmpp) => { logger.warn(`Received ${exitCode}/${signal} (application is closing), disconnect from XMPP server`) try { xmpp.close() - .then(logger.debug('Connection successfully closed')) + .then(() => { + logger.debug('Connection successfully closed') + }) .catch((error) => { logger.error('Error during XMPP disconnection', error) }) diff --git a/lib/xmpp/index.js b/lib/xmpp/index.js index 3325c90..301156e 100644 --- a/lib/xmpp/index.js +++ b/lib/xmpp/index.js @@ -45,7 +45,9 @@ module.exports = (logger, config) => { this.jid = address // send presence xmppClient.send(xml('presence')) - .then(logger.debug('presence sent')) + .then(() => { + logger.debug('presence sent') + }) .catch((error) => { logger.warn('presence returned following error:', error) }) @@ -139,7 +141,9 @@ module.exports = (logger, config) => { // connect xmppClient.start() - .catch(logger.error) + .catch((error) => { + logger.error('XMPP client encountered following error at connection', error) + }) return this } diff --git a/test/config.json b/test/config.json index 987b767..e7c6cb3 100644 --- a/test/config.json +++ b/test/config.json @@ -45,6 +45,7 @@ "domain": "domain-xmpp.ltd", "username": "bot@domain-xmpp.ltd", "password": "botPass", + "resource": "botservice", "rooms": [ { "id": "roomname@conference.domain-xmpp.ltd",