Rethrow exception if connect fails