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

Function TestWrapDoAPIError_SDKClientTimeout

internal/client/api_errors_test.go:144–153  ·  view source on GitHub ↗

TestWrapDoAPIError_SDKClientTimeout pins that a *larkcore.ClientTimeoutError (client-side request timeout the SDK reports without satisfying net.Error) classifies as timeout.

(t *testing.T)

Source from the content-addressed store, hash-verified

142// (client-side request timeout the SDK reports without satisfying net.Error)
143// classifies as timeout.
144func TestWrapDoAPIError_SDKClientTimeout(t *testing.T) {
145 got := WrapDoAPIError(&larkcore.ClientTimeoutError{})
146 var ne *errs.NetworkError
147 if !errors.As(got, &ne) {
148 t.Fatalf("expected *errs.NetworkError, got %T", got)
149 }
150 if ne.Subtype != errs.SubtypeNetworkTimeout {
151 t.Errorf("Subtype = %v, want %v", ne.Subtype, errs.SubtypeNetworkTimeout)
152 }
153}
154
155// TestWrapDoAPIError_UnknownCause_FallsBackToTransport pins the fallback:
156// when none of the specific causes match, NetworkError uses the generic

Callers

nothing calls this directly

Calls 2

WrapDoAPIErrorFunction · 0.85
AsMethod · 0.80

Tested by

no test coverage detected