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

Function TestWrapDoAPIError_DNS

internal/client/api_errors_test.go:116–125  ·  view source on GitHub ↗

TestWrapDoAPIError_DNS pins that a *net.DNSError classifies as NetworkError{Subtype: dns}.

(t *testing.T)

Source from the content-addressed store, hash-verified

114// TestWrapDoAPIError_DNS pins that a *net.DNSError classifies as
115// NetworkError{Subtype: dns}.
116func TestWrapDoAPIError_DNS(t *testing.T) {
117 got := WrapDoAPIError(&net.DNSError{Name: "example.invalid"})
118 var ne *errs.NetworkError
119 if !errors.As(got, &ne) {
120 t.Fatalf("expected *errs.NetworkError, got %T", got)
121 }
122 if ne.Subtype != errs.SubtypeNetworkDNS {
123 t.Errorf("Subtype = %v, want %v", ne.Subtype, errs.SubtypeNetworkDNS)
124 }
125}
126
127// TestWrapDoAPIError_SDKServerTimeout pins that a *larkcore.ServerTimeoutError
128// (504 Gateway Timeout surfaced by the SDK as a typed error rather than an

Callers

nothing calls this directly

Calls 2

WrapDoAPIErrorFunction · 0.85
AsMethod · 0.80

Tested by

no test coverage detected