我的神经技能有问题。奇怪的是,只有当我通过cortana通道测试deplyoed代码时才会发生例外 - 如果我测试机器人本身(例如通过bot模拟器),则没有例外!
再次:问题是:只有当我通过Cortana触发对话时才会出现以下异常情况!
应用洞察:
POST to xyzBOT failed: POST to the bot's endpoint failed with HTTP status 500POST to the bot's endpoint failed with HTTP status 500
Failed Method:
Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.Mo...
Stack:
Microsoft.Bot.Schema.BotException
Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.MoveNext
BotAPI.cs - Line 292
Interne Exception "System.Exception" handeled at
"Microsoft.Bot.ChannelConnector.BotAPI+d__29.MoveNext"
Microsoft.Bot.ChannelConnector.BotAPI<PostActivityToBotAsync> d__29.MoveNext
BotAPI.cs - Line 288
[...]
public class RootDialog : LuisDialog<string>
{
[...]
[LuisIntent(nameof(LUISXY))]
private async Task LUISXY(IDialogContext context, LuisResult result)
{
context.Call(new ZDialog(), null);
}
}
[...]
public class ZDialog: IDialog
{
public async Task StartAsync(IDialogContext context)
{
ShowOptions(context, true);
}
}
[...]
private async Task OnOptionSelected(IDialogContext context, IAwaitable<string> result)
{
try
{
var optionSelected = await result;
if (optionSelected.Equals(AppResources.OptionA))
{
context.Call(new ADialog(), null);
}
else if (optionSelected.Equals(AppResources.OptionB))
{
context.Call(new BDialog(), null);
}
}
catch (TooManyAttemptsException)
{
await context.PostAsync("Too many attempts");
ShowOptions(context, false);
}
}
}