Add a List All the Notes API - 500 error

Hi, I I am following the tutorial here.

Everything has worked perfectly up until I try
serverless invoke local --function list --path mocks/list-event.json
this is the error:

{
    "statusCode": 500,
    "headers": {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Credentials": true
    },
    "body": "{\"status\":false}"
}

I have double checked the code and even copied pasted all the relevant files to my local.
All the other local functions like create/get/update work just fine, so I don’t know what’s going on.
any help please ! thanks

The status: false errors are generated in our code. So you can debug them by adding a console.log in your Lambda function.

ok gotcha. thanks for the info !

I am new to this…where in the Lambda function would you write that?

No worries, I think I answered you in the other thread.

anywhere in here :

try {
    const result = await dynamoDbLib.call("query", params);
    console.log(result);
    // Return the matching list of items in response body
    return success(result.Items);
  } catch (e) {
    console.log(e);
    return failure({ status: false });
  }

i had the the error ‘Query condition missed key schema element: noteId’, this was because i accdientally created the table with the wrong partition key

1 Like