MCPcopy
hub / github.com/larksuite/cli / TestWrapDoAPIError_MessageContainsCause

Function TestWrapDoAPIError_MessageContainsCause

internal/client/api_errors_test.go:305–311  ·  view source on GitHub ↗

TestWrapDoAPIError_MessageContainsCause pins that the wrapped error's message is carried into Problem.Message so logs / debugging retain the underlying cause string.

(t *testing.T)

Source from the content-addressed store, hash-verified

303// message is carried into Problem.Message so logs / debugging retain the
304// underlying cause string.
305func TestWrapDoAPIError_MessageContainsCause(t *testing.T) {
306 raw := errors.New("dial tcp 10.0.0.1:443: i/o timeout")
307 got := WrapDoAPIError(raw)
308 if !strings.Contains(got.Error(), "i/o timeout") {
309 t.Errorf("Error() = %q, want to contain underlying cause", got.Error())
310 }
311}

Callers

nothing calls this directly

Calls 3

WrapDoAPIErrorFunction · 0.85
ContainsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected