fail on connection errors
Merge pull request #4 from shalupov/master

Script should exit with non-zero error code on connection errors