diff --git a/src/utils/logger.js b/src/utils/logger.js index dd3f62c..96f6360 100644 --- a/src/utils/logger.js +++ b/src/utils/logger.js @@ -45,6 +45,8 @@ const settings = { if (config.mode === 'development') { settings.INFO = true; settings.DEBUG = true; +} if (config.mode === 'test') { + settings.WARN = false; } function log(level, string) { diff --git a/src/utils/webhookUtils.js b/src/utils/webhookUtils.js index 17383bf..41a2b13 100644 --- a/src/utils/webhookUtils.js +++ b/src/utils/webhookUtils.js @@ -35,10 +35,13 @@ function dispatchEvent(scope, data) { let authKey = webhook.key; let scopes = webhook.scopes || []; if (!scopes.includes(scope.toLowerCase())) return; - request.post(webhookURL, {json: data, headers: { + let hookRequest = request.post(webhookURL, {json: data, headers: { "Authorization": authKey, "Event-Type": scope // Maybe change this in the future? - }}); + }}).on('error', (e) => { + logger.warn('Couldn\'t send webhook to ' + webhook.url); + logger.warn(e); + }); }); }