MCPcopy Index your code
hub / github.com/larksuite/cli / TestWrapDoAPIError_TLS_HandshakeMessage

Function TestWrapDoAPIError_TLS_HandshakeMessage

internal/client/api_errors_test.go:103–112  ·  view source on GitHub ↗

TestWrapDoAPIError_TLS_HandshakeMessage covers the message-substring fallback for TLS errors that don't surface as a typed x509 error.

(t *testing.T)

Source from the content-addressed store, hash-verified

101// TestWrapDoAPIError_TLS_HandshakeMessage covers the message-substring fallback
102// for TLS errors that don't surface as a typed x509 error.
103func 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}.

Callers

nothing calls this directly

Calls 2

WrapDoAPIErrorFunction · 0.85
AsMethod · 0.80

Tested by

no test coverage detected