i'm doing this:
context.fail({
message: "Invalid Token!",
code: app.error["010"].code,
});
and when i call api from postman, it is returning me:
{
"errorMessage": "[object Object]"
}
even i'm not sending any key named errorMessage
My question is, am i using correct way to return error if yes, why it is behaving like this if no, what is the correct way to handling error in serverless
I'll be thankful.