From 3e9653b9cf08340212f3f7956df7a47ce63ab561 Mon Sep 17 00:00:00 2001 From: Cedric Hoelzl Date: Fri, 20 Sep 2019 12:42:17 +0200 Subject: [PATCH] fix --- config.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config.js b/config.js index 8c43056..11556ad 100644 --- a/config.js +++ b/config.js @@ -34,13 +34,17 @@ module.exports = function(url, cmds){ }; return new Promise((resolve,reject)=>{ return request.get(options, function (err, response, body) { - if (err) + if (err) { + bot.error(err); return reject(500); + } - if (response.statusCode != 200 ) + if (response.statusCode != 200 ){ + bot.error(response.statusCode); return reject(500);//response.statusCode); + } - event.reply(body.reply).catch(err=>bot.error(500)); + event.reply(body.reply).catch(err=>bot.error(err)); return resolve(200); });