Catch connection refused socket error.