Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
984 views
in Technique[技术] by (71.8m points)

amazon web services - How to troubleshoot this AWS lambda error - An error has occurred: Received error response from Lambda: Unhandled?

I'm new to AWS. I'm build chatbot using aws lex and aws lambda c#. I'm using sample aws lambda C# program

namespace AWSLambda4
{
    public class Function
    {

        /// <summary>
        /// A simple function that takes a string and does a ToUpper
        /// </summary>
        /// <param name="input"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public string FunctionHandler(string input, ILambdaContext context)
        {
            try
            {
                return input?.ToUpper();
            }
            catch (Exception e)
            {

                return "sorry i could not process your request due to " + e.Message;
            }
        }
    }
}

I created a slot in aws lex to map first parameter input . But i'm always getting this error An error has occurred: Received error response from Lambda: Unhandled

In Chrome network tab i could see Error- 424 Failed Dependency which is related to authentication.

Please help how to troubleshoot AWS lambda C# error which is used by aws lex. I came across cloudwatch but I'm not sure about that.

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The communication between Lex and Lambda is not straight forward like normal functions. Amazon Lex expects output from Lambda in a particular JSON format and data like slot details etc are also sent to Lambda in a similar JSON. You can find the blueprints for them here: Lambda Function Input Event and Response Format. Make sure your C# code also return a JSON in the similar fashion, so that Lex can understand and do the further processing.

Hope it helps!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...