Get the connection index name

Hello, I want to get the name of the port in the index of the connection. I used the ‘getPortName’ method, but the format seems to be unavailable by error