[connectionagent] make connectToType work correctly, discard some errors

If type is already connected, don't popup dialog.