title: How to send error to DLQ if Lambda function throws error (not timedOut)?
body: <p>I am having Lambda function that I expect to return some result. So if I send wrong parameters it fails for example in the middle of the function.</p>
  
  <p>Is there a way I can handle if any error occurs to be sent in my DLQ, print the error in the message, then retry, then delete the message?</p>
  
  <ul>
  <li>example error from CloudWatch:</li>
  </ul>
  
  <blockquote>
    <p>TypeError: commandArray is not iterable</p>
  </blockquote>