TestWrapDoAPIError_TLS_HandshakeMessage covers the message-substring fallback for TLS errors that don't surface as a typed x509 error.
(t *testing.T)
| 101 | // TestWrapDoAPIError_TLS_HandshakeMessage covers the message-substring fallback |
| 102 | // for TLS errors that don't surface as a typed x509 error. |
| 103 | func TestWrapDoAPIError_TLS_HandshakeMessage(t *testing.T) { |
| 104 | got := WrapDoAPIError(errors.New("remote error: tls: handshake failure")) |
| 105 | var ne *errs.NetworkError |
| 106 | if !errors.As(got, &ne) { |
| 107 | t.Fatalf("expected *errs.NetworkError, got %T", got) |
| 108 | } |
| 109 | if ne.Subtype != errs.SubtypeNetworkTLS { |
| 110 | t.Errorf("Subtype = %v, want %v", ne.Subtype, errs.SubtypeNetworkTLS) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | // TestWrapDoAPIError_DNS pins that a *net.DNSError classifies as |
| 115 | // NetworkError{Subtype: dns}. |
nothing calls this directly
no test coverage detected