如何在Microsoft bot框架中处理NoResumeHandler异常?

时间:2017-02-06 12:21:52

标签: botframework

如何使用Microsoft Bot Framework处理chatbot中的异常。我得到了下面的例外,因为我给出了一个错误的LUIS订阅密钥,但我想处理异常并提供自定义消息而不是下面的消息!

  

NoResumeHandlerException:完成IDialog方法,没有通过IDialogStack指定的简历处理程序。

以下是MessageController的代码.. exception message

if (activity.Type == ActivityTypes.Message)
            {
                //await Microsoft.Bot.Builder.Dialogs.Conversation.SendAsync(activity, () => new ContactOneDialog());

                //Implementation of typing indication
                //ConnectorClient connector = new ConnectorClient(new System.Uri(activity.ServiceUrl));
                //Activity isTypingReply = activity.CreateReply("Shuttlebot is typing...");
                //isTypingReply.Type = ActivityTypes.Typing;
                //await connector.Conversations.ReplyToActivityAsync(isTypingReply);

                logger.Debug("The User's local timeStamp is: " + activity.LocalTimestamp + "and service timeStamp is: " + activity.Timestamp);
                await Conversation.SendAsync(activity, () =>
                new ExceptionHandlerDialog<object>(new ShuttleBusDialog(), displayException: true));
            }
            else
            {
                HandleSystemMessage(activity);
            }

0 个答案:

没有答案