ToothlessGear/node-gcm — pull request #6 by monkbroc (2012-07-11 12:05:49+00:00)
Title: Added error handler to HTTPS request to handle DNS exceptions

Hello again,

I made another small fix to handle exceptions thrown by the HTTPS request, such as failed DNS resolutions. This can happen if the internet connection is temporarily down on the server.

Without this fix, Node.js simply shuts down because of an unhandled exception.

The error handler simply logs the error and triggers the normal retry process with exponential backoff.

You can test the change by setting 'GCM_SEND_ENDPOINT' : 'android.googleapis1234.com' and sending a GCM message.