Alexa.Net无法创建提醒:抛出错误

时间:2019-05-10 06:24:57

标签: c# alexa-skills-kit

使用项目中的代码库创建提醒时,出现以下错误:

  

Alexa.NET.Response.RemindersClient.d__8.MoveNext()发生错误   ---从之前引发异常的位置开始的堆栈结束跟踪---   在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)   在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)   在AlexaWebAPI.Controllers.ReminderController.d__0.MoveNext()

我正在使用的示例代码:

try
{
    var reminder = new Reminder
    {
        RequestTime = DateTime.UtcNow,
        Trigger = new RelativeTrigger(12 * 60 * 60),
        AlertInformation = new AlertInformation(new[] {new SpokenContent("it's a test", "en-GB") }),
        PushNotification = PushNotification.Disabled
    };
    var client = new RemindersClient(RemindersClient.ReminderDomain,input.Session.User.AccessToken);
    var alertDetail = await client.Create(reminder);
    Trace.TraceInformation(alertDetail.AlertToken);
    return ResponseBuilder.Tell($"I would to create a reminder on ${date} .");
}
catch(Exception ex)
{
    Trace.TraceError(ex.StackTrace);
    return ResponseBuilder.Ask("Some error occured while creating reminder", null);
}

0 个答案:

没有答案