Merge pull request #490 from iamqizhao/master

Specialize connection error handling