title: What causes a ECONNREFUSED, Connection refused at Error (native) in an AWS node Lambda?
body: <p>In load testing our AWS Lambda node function, we have got the following error message in our Cloudwatch logs:</p>
  
  <pre><code>2017-10-16T03:13:15.606Z    e95f33aa-b21f-11e7-8f1a-89b123118211    Error: ECONNREFUSED, Connection refused at Error (native)
  </code></pre>
  
  <p>This is the only line that is output and it only happens during load testing. With 10,000 requests, there are 200 of these errors and they happen towards the beginning of the load test.</p>
  
  <p>Eventually everything succeeds because of retries but it would be nice to know what causes this. We have a try-catch block wrapping all of our code but it's not catching this error.</p>
  
  <p>What causes this error and how can it be avoided or caught?</p>