From 90517ae65425e45c1b60ede94dd9b1bc3316ff7c Mon Sep 17 00:00:00 2001 From: Stephen Marx Date: Tue, 23 Oct 2018 11:18:05 +0100 Subject: [PATCH] Fix/Issue 159: Fix exceptions being swallowed by BootBot --- lib/BootBot.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/BootBot.js b/lib/BootBot.js index 1b60321..798c534 100644 --- a/lib/BootBot.js +++ b/lib/BootBot.js @@ -285,7 +285,11 @@ class BootBot extends EventEmitter { } return res; }) - .catch(err => console.log(`Error sending message: ${err}`)); + .catch(err => { + console.log(`Error sending message: ${err}`); + + throw err; + }); } /** @@ -337,7 +341,11 @@ class BootBot extends EventEmitter { const url = `https://graph.facebook.com/v2.12/${userId}?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=${this.accessToken}`; return fetch(url) .then(res => res.json()) - .catch(err => console.log(`Error getting user profile: ${err}`)); + .catch(err => { + console.log(`Error getting user profile: ${err}`); + + throw err; + }); } /**