Avoid multiple returns of connect errors