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

Function TestWrapDoAPIError_TLS

internal/client/api_errors_test.go:90–99  ·  view source on GitHub ↗

TestWrapDoAPIError_TLS pins that an x509.UnknownAuthorityError classifies as NetworkError{Subtype: tls}.

(t *testing.T)

Source from the content-addressed store, hash-verified

88// TestWrapDoAPIError_TLS pins that an x509.UnknownAuthorityError classifies
89// as NetworkError{Subtype: tls}.
90func 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.

Callers

nothing calls this directly

Calls 2

WrapDoAPIErrorFunction · 0.85
AsMethod · 0.80

Tested by

no test coverage detected