Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1151 from Naktibalda/patch-4
Browse files Browse the repository at this point in the history
[CoreBot] Don't suppress errors
  • Loading branch information
Ben Brown authored Jan 10, 2018
2 parents 6fe3860 + 3a8e43f commit 38724ff
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/CoreBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -1211,10 +1211,16 @@ function Botkit(configuration) {
botkit.middleware.send.run(worker, message, function(err, worker, message) {
if (err) {
botkit.log('An error occured in the send middleware:: ' + err);
if (cb) {
cb(err);
}
} else {
botkit.middleware.format.run(worker, message, platform_message, function(err, worker, message, platform_message) {
if (err) {
botkit.log('An error occured in the format middleware: ' + err);
if (cb) {
cb(err);
}
} else {
worker.send(platform_message, cb);
}
Expand All @@ -1234,7 +1240,7 @@ function Botkit(configuration) {

botkit.middleware.spawn.run(worker, function(err, worker) {
if (err) {
botkit.log('Error in middlware.spawn.run: ' + err);
botkit.log('Error in middleware.spawn.run: ' + err);
} else {
botkit.trigger('spawned', [worker]);

Expand Down Expand Up @@ -1345,6 +1351,9 @@ function Botkit(configuration) {

this.say = function(message, cb) {
botkit.debug('SAY:', message);
if (cb) {
cb();
}
};

this.replyWithQuestion = function(message, question, cb) {
Expand Down

0 comments on commit 38724ff

Please sign in to comment.