Example: > $ telnet ollama.org 12499 > Trying 176.123.6.177... > telnet: connect to address 176.123.6.177: Connection refused > telnet: Unable to connect to remote host > $ nc ollama.org 12499 > $ echo $? > 1 > $ telnet prints the correct error message, but nc doesn't. nc just fails with exit_code=1.
This is intentional: netcat is designed to try any number of addresses and ports until one succeeds (for instance, if you give it a host name which resolves to multiple addresses) and there is no correct answer to the question of which error(s) to report in such a scenario: all, or just one? If just one, which one? What if one is more significant than the others? etc. Use the -v option if you want explicit error messages for every failed operation.