Better error handling when connection refused