CURL timeout error handling (Connection/Operation timed out)
--connect-timeout to separate the timeout of the handshake phase.
In addition, CURL can distinguish timeout errors at different stages: "connection timeout" and "operation timeout".
For example, CURL command with 5 second connection timeout and 25 second maximum timeout setting:
$ curl -v --connect-timeout 5 -m 25 "https://yourname.com"
Example of Error
curl: (28) Connection timed out after 5004 milliseconds
curl: (28) Operation timed out after 25005 milliseconds with 0 bytes received
Both timeout error codes are "28" and cannot be identified by code, but can be identified by message.