Mr.9715
06/01/2021, 2:02 PMcontext.done(null, event);
. on another lambda which I am running locally, I am trying to call signup. the trigger executes successfully but Cognito is throwing an error. (if I remove the trigger, everything works fine)Ashishkumar Pandey
06/01/2021, 2:06 PMMr.9715
06/01/2021, 2:09 PMAshishkumar Pandey
06/01/2021, 2:10 PMMr.9715
06/01/2021, 2:15 PMAshishkumar Pandey
06/01/2021, 2:16 PMMr.9715
06/01/2021, 2:28 PMMr.9715
06/01/2021, 2:47 PMFrank
{"type":"success","data":null}
. If you are simply returning the event object:
context.done(null, event)
Any idea why âdataâ is null?Mr.9715
06/01/2021, 5:23 PMFrank
export.handler = function(event, context) {
context.done(null, event)
}
to:
export.handler = function(event, context, callback) {
callback(null, event);
}
Frank
context.done
as itâs the deprecated way to send the response back. Starting nodejs10.x
, Lambda switched to using the callback
Frank
Mr.9715
06/01/2021, 7:45 PMInvalidLambdaResponseException
when I don't return an event and { "type": "success", body: none/event }
when i do callback(new Error("an error")). or callback("Error") or callback("Error", event)
In any case caller doesn't receive the error message when using callback or return. This however worked with context.done(), fail etc.
*Issue on cognito sideMr.9715
06/01/2021, 7:48 PMFrank
callback(new Error("an error"), event)
?Mr.9715
06/01/2021, 7:58 PMFrank
callback(new Error("My Error"), event);
isnât triggering the error.
So I just tried this:
export function main(event, context, callback) {
const error = new Error("my error");
callback(error, event);
}
And Iâm seeing an error when invoked:Frank
Mr.9715
06/02/2021, 4:18 AMreturn
on line 20. đ Sorry for the false alarm.