Better exception handling during connect