TestWrapDoAPIError_TLS pins that an x509.UnknownAuthorityError classifies as NetworkError{Subtype: tls}.
(t *testing.T)
| 88 | // TestWrapDoAPIError_TLS pins that an x509.UnknownAuthorityError classifies |
| 89 | // as NetworkError{Subtype: tls}. |
| 90 | func TestWrapDoAPIError_TLS(t *testing.T) { |
| 91 | got := WrapDoAPIError(&x509.UnknownAuthorityError{}) |
| 92 | var ne *errs.NetworkError |
| 93 | if !errors.As(got, &ne) { |
| 94 | t.Fatalf("expected *errs.NetworkError, got %T", got) |
| 95 | } |
| 96 | if ne.Subtype != errs.SubtypeNetworkTLS { |
| 97 | t.Errorf("Subtype = %v, want %v", ne.Subtype, errs.SubtypeNetworkTLS) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | // TestWrapDoAPIError_TLS_HandshakeMessage covers the message-substring fallback |
| 102 | // for TLS errors that don't surface as a typed x509 error. |
nothing calls this directly
no test coverage detected