mr-rigden/alexa_template

KeyError

Closed this issue · 1 comments

Hello!
I'm having trouble trying the codes from your tutorial, I keep getting KeyErrors.
def lambda_handler(event, context): if event['request']['type'] == "LaunchRequest": return on_launch(event, context)
I get KeyErrors from the 'request' and 'type'
here are the error messages
{ "errorMessage": "'request'", "errorType": "KeyError", "stackTrace": [ [ "/var/task/lambda_function.py", 4, "lambda_handler", "if event['request']['type'] == \"LaunchRequest\":" ] ] }
Here is the error log:
START RequestId: 70dd82f9-6bc3-11e8-b25c-c14a803a833c Version: $LATEST 'request': KeyError Traceback (most recent call last): File "/var/task/lambda_function.py", line 4, in lambda_handler if event['request']['type'] == "LaunchRequest": KeyError: 'request'
Can someone explain to me what is causing the KeyError? How do I fix this?
Thank You!

Nevermind, I just realised that I didn't change test configuration event.