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

Method Error

cli/error.go:13–23  ·  view source on GitHub ↗

Error formats the error for printing. If a custom Status is provided, it is returned as-is, otherwise it generates a generic error-message based on the StatusCode.

()

Source from the content-addressed store, hash-verified

11// it is returned as-is, otherwise it generates a generic error-message
12// based on the StatusCode.
13func (e StatusError) Error() string {
14 if e.Status != "" {
15 return e.Status
16 }
17 if e.Cause != nil {
18 return e.Cause.Error()
19 }
20 // we don't want to set a default message here,
21 // some commands might want to be explicit about the error message
22 return ""
23}
24
25func (e StatusError) Unwrap() error {
26 return e.Cause

Callers 15

TestValidateIPAddressFunction · 0.45
TestMapOptsFunction · 0.45
TestValidateLabelFunction · 0.45
TestValidateLinkFunction · 0.45
TestParseLinkFunction · 0.45
TestGpusOptInvalidCountFunction · 0.45
TestMountOptErrorsFunction · 0.45
TestMountOptReadOnlyFunction · 0.45
TestMountOptVolumeNoCopyFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestValidateIPAddressFunction · 0.36
TestMapOptsFunction · 0.36
TestValidateLabelFunction · 0.36
TestValidateLinkFunction · 0.36
TestParseLinkFunction · 0.36
TestGpusOptInvalidCountFunction · 0.36
TestMountOptErrorsFunction · 0.36
TestMountOptReadOnlyFunction · 0.36
TestMountOptVolumeNoCopyFunction · 0.36