handle a wider range of connect() errors gracefully