I have a lambda trigger on an SQS queue which is configured with a DLQ.
When my lambda failed the original message from the queue will be redirected to the DLQ.
Now I want to add more information to this original message (like why there was an error etc). I know that I can't modify the original message but I saw that a message can have additional message attributes RequestID, ErrorCode, ErrorMessage.
How can I use/ setup them from my lambda function (NodeJS) ?

throw new Error((err.message) ? err.message : JSON.stringify(err)). Is there a way to specify the attributes manually ? - Marc Sirisak