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

Function TestWrapDoAPIError_SDKServerTimeout

internal/client/api_errors_test.go:130–139  ·  view source on GitHub ↗

TestWrapDoAPIError_SDKServerTimeout pins that a *larkcore.ServerTimeoutError (504 Gateway Timeout surfaced by the SDK as a typed error rather than an *http.Response) classifies as timeout — upstream took too long to respond.

(t *testing.T)

Source from the content-addressed store, hash-verified

128// (504 Gateway Timeout surfaced by the SDK as a typed error rather than an
129// *http.Response) classifies as timeout — upstream took too long to respond.
130func TestWrapDoAPIError_SDKServerTimeout(t *testing.T) {
131 got := WrapDoAPIError(&larkcore.ServerTimeoutError{})
132 var ne *errs.NetworkError
133 if !errors.As(got, &ne) {
134 t.Fatalf("expected *errs.NetworkError, got %T", got)
135 }
136 if ne.Subtype != errs.SubtypeNetworkTimeout {
137 t.Errorf("Subtype = %v, want %v", ne.Subtype, errs.SubtypeNetworkTimeout)
138 }
139}
140
141// TestWrapDoAPIError_SDKClientTimeout pins that a *larkcore.ClientTimeoutError
142// (client-side request timeout the SDK reports without satisfying net.Error)

Callers

nothing calls this directly

Calls 2

WrapDoAPIErrorFunction · 0.85
AsMethod · 0.80

Tested by

no test coverage detected