MCPcopy Index your code
hub / github.com/docker/cli / TestPluginError

Function TestPluginError

cli-plugins/manager/error_test.go:12–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestPluginError(t *testing.T) {
13 err := newPluginError("new error")
14 assert.Check(t, is.Error(err, "new error"))
15
16 inner := errors.New("testing")
17 err = wrapAsPluginError(inner, "wrapping")
18 assert.Check(t, is.Error(err, "wrapping: testing"))
19 assert.Check(t, is.ErrorIs(err, inner))
20
21 actual, err := json.Marshal(err)
22 assert.Check(t, err)
23 assert.Check(t, is.Equal(`"wrapping: testing"`, string(actual)))
24
25 err = wrapAsPluginError(nil, "wrapping")
26 assert.Check(t, is.Error(err, "wrapping: %!w(<nil>)"))
27}

Callers

nothing calls this directly

Calls 3

newPluginErrorFunction · 0.85
wrapAsPluginErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…