keenlabs/KeenClient-Node — pull request #3 by markuscraig (2013-10-18 23:28:28+00:00)
Title: Path to catch SuperAgent errors when accessing the Keen.io API...

Hey Daniel,

This may not be the way you want to handle errors, but it's been helpful for me. I wrote a tool to simulate multiple devices sending stats to Keen, and I noticed that I was occasionally getting 'Error: socket hang up' errors, causing the script to stop. I add SuperAgent's '.on' method to the call chain to catch the errors and display a message. I could probably just use process.on('error', blah), but I did not want to catch all of the other errors. Passing this along in case it's useful...

Thanks!
Mark