Closed jcampbell05 closed 6 years ago
Great idea!! Maybe the default would be like you say + we could give the developers a way of switching to:
1 (default) - Respond to the user "I'm sorry, ... " + warn message in logger 2 - Don't say anything but pop a Botpress notifications + a warn message logger 3 - Warn in logger only 4 - Custom handler
What do you think?!
Yeah maximum flexibility :)
Cool! Like this idea. Let's implement this :)
+1
@fstn Hey so this has been implemented but isn't documented: https://github.com/botpress/botpress/blob/b862db4a5f3eb39bdbd20afae46b12dc3138398a/src/fallback.js
Would appreciate a PR to the doc
Hi, Can you provide detail explanation for this. Where we can add this script or if it can be handled at UI
We should have a way of having a bot send a message when the server encounters an error for a better experience for users.
Additionally in Bottr I had a way of detecting when a incoming message wasn't handled and have the bot automatically respond to let the user it hadn't been taught what to do with that message.
This catch all was good for UX since the developer could spot code paths they missed out easily and it didn't strand the user.
How it worked is there was a middleware which always was executed last which would send "sorry I wasn't taught anything else". When implementing the equivalent of the Hears middleware in Bottr it would only call the next middleware for the incoming message chain when there wasn't a match.
Eventually if nothing had handled the incoming text then the catch-all middleware would be triggered.