Closer-to-proper error handling for connect