Fix bug in error handling
Avoid modifing the global errMsg object
Avoid errors on accessing twice HTTP_CONNECTION_ERROR property
Pass the right object to callback function
Merge pull request #3 from artoale/master

Fix bug in error handling