forked from vxmppb/vxmppb
Error catching when user doesn't have config.ini
This commit is contained in:
parent
27678bdbf8
commit
6bcd1c1e38
7
index.js
7
index.js
|
@ -7,6 +7,10 @@ let Parser = require('rss-parser');
|
|||
let parser = new Parser();
|
||||
const xmpp = require('simple-xmpp');
|
||||
|
||||
try {
|
||||
fs.readFileSync('./config.ini', 'utf-8');
|
||||
|
||||
|
||||
const config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'));
|
||||
const api_pass = config.api_pass;
|
||||
const api_url = config.api_url;
|
||||
|
@ -266,3 +270,6 @@ xmpp.connect({
|
|||
|
||||
// Checks the XMPP server for new 'friend' requests
|
||||
console.log(xmpp.getRoster());
|
||||
} catch(e) {
|
||||
console.log("Please create a config.ini");
|
||||
}
|
Reference in New Issue
Block a user