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

Add receive_error event if middleware throws error #1425

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

mkilp
Copy link
Contributor

@mkilp mkilp commented Jul 23, 2018

Previously, if an error occurred in the receive middleware, the message would just get swallowed and not processed. The error is just logged to console. Now an actual event is fired which can be caught in a skill.

  • CoreBot.js: firing receive_error event with the error message of the middleware
  • Error can be caught by using controller.on('receive_error', function(err, bot, message){[HANDLE THE ERROR...]});

Previously, if an error occurred in the receive middleware, the message would just get swallowed and not processed. The error is just logged to console. Now an actual event is fired which can be caught in a skill.

- CoreBot.js: firing receive_error event with the error message of the middleware
- Error can be caught by using `controller.on('receive_error', function(err, bot, message){[HANDLE THE ERROR...]});`
mkilp added a commit to mkilp/botkit-docs that referenced this pull request Jul 23, 2018
Update the core docs to explain how to handle errors in receive middlewares.

Related to howdyai/botkit#1425
@peterswimm peterswimm requested a review from benbrown July 25, 2018 18:36
@benbrown
Copy link
Contributor

This is merged into my next release branch!

@benbrown benbrown merged commit d52167b into howdyai:master Oct 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants