'--silent', or '-s', turns off both the progress meter and the error output. A failed request in a script run with -s produces nothing at all on stderr, so a DNS failure, a refused connection, and a TLS verification error are indistinguishable from each other and from a successful empty response.
'--show-error', or '-S', restores error messages while keeping the progress meter off. The combination '-sS' is what belongs in every script, and adding '-f' or '--fail-with-body' covers HTTP status as well, giving the common preamble 'curl -sSf'.
For diagnosis, the exit code is more precise than the message. Code 6 is a name resolution failure, 7 is a failure to connect, 28 is a timeout, 35 is a TLS handshake failure, 56 is a receive failure, and 60 is a certificate that could not be verified with the known CA bundle. The full list is published with libcurl. Capture it with 'curl ...; rc=$?' and branch on it rather than parsing English text, which changes between releases.