How to avoid “Sorry, my bot code is having an issue” in Microsoft Bot Framework

梦想的初衷 提交于 2019-11-28 23:10:33

The message is sent to the user in PostUnhandledExceptionToUserTask only because the exception has escaped the root dialog A. You can avoid this situation by preventing unhandled exceptions from escaping the root dialog A.

One option is to add a different root dialog B that simply calls your dialog A and then simply ignores the IAwaitable<R> result that is passed to the ResumeAfter<R> callback.

Chain.DefaultIfException provides an implementation of dialog B.

sakshi agrawal

You can use DefaultIfException functionality for Bot Framework to internally handle the exception.

It looks like this:

await Conversation.SendAsync(
   activity, () => new Dialogs.RootDialog().DefaultIfException()
);
renzo.barrios1407

When you get an 403 or 429, it could be "out of quota" or "Too many request" respectively, in the first case you must create a key again and asign to your LUIS App, the first-1000 endpoint queries are free and it will be refreshed every month, you must use it wisely or you have to use a Paid tier.

For the second case you have also a limit for the request, see the Boundaries documentation

Here you can find Microsoft documentation about this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!