Differentiate DNS resolution and cert errors for metadata vs. external requests
Differentiate DNS resolution and cert errors for metadata vs. external requests

The goal of this CL is to improve behavior on GCS file requests from within TensorFlow, which often fail due to transient DNS resolution failures.

This change provides more granular error handling, distinguishing between non-retriable errors (metadata server DNS, certificate) and potentially transient network issues (other DNS failures) when deciding when to retry. Resolution failures for URIs like "metadata" or "metadata.google.internal" result in a FailedPrecondition error, since a retry is very likely to still fail.

Non-metadata DNS failures trigger an Unavailable error, indicating potential for resolution on retry.

Certificate validation errors (CURLE_SSL_CACERT_BADFILE) result in a FailedPrecondition error.

Other errors default to Unavailable for the possibility of retries.
