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 #1253 from krashidov/respond500
Browse files Browse the repository at this point in the history
returning 500 status code under error conditions
  • Loading branch information
Ben Brown authored Mar 15, 2018
2 parents 2d64825 + 0ba0adb commit 8f2988c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/SlackBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ function Slackbot(configuration) {
slack_botkit.findAppropriateTeam(payload, function(err, team) {
if (err) {
slack_botkit.log.error('Could not load team while processing webhook: ', err);
return;
return res.status(500).send();
} else if (!team) {
// if this is NOT a slack app, it is ok to spawn a generic bot
// this is only likely to happen with custom slash commands
if (!slack_botkit.config.clientId) {
bot = slack_botkit.spawn({});
} else {
return;
return res.status(500).send();
}
} else {
// spawn a bot
Expand All @@ -223,7 +223,7 @@ function Slackbot(configuration) {

if (!team.bot) {
slack_botkit.log.error('No bot identity found.');
return;
return res.status(500).send();
}

}
Expand Down

0 comments on commit 8f2988c

Please sign in to comment.