mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix definition of ErrSystem type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
59854e407d
commit
d48392a35b
2 changed files with 14 additions and 1 deletions
|
@ -35,7 +35,7 @@ type ErrForbidden interface {
|
|||
// ErrSystem signals that some internal error occurred.
|
||||
// An example of this would be a failed mount request.
|
||||
type ErrSystem interface {
|
||||
ErrSystem()
|
||||
System()
|
||||
}
|
||||
|
||||
// ErrNotModified signals that an action can't be performed because it's already in the desired state
|
||||
|
|
|
@ -179,3 +179,16 @@ func TestUnavailable(t *testing.T) {
|
|||
t.Fatalf("causual should be errTest, got: %v", cause)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystem(t *testing.T) {
|
||||
if IsSystem(errTest) {
|
||||
t.Fatalf("did not expect system error, got %T", errTest)
|
||||
}
|
||||
e := System(errTest)
|
||||
if !IsSystem(e) {
|
||||
t.Fatalf("expected system error, got %T", e)
|
||||
}
|
||||
if cause := e.(causal).Cause(); cause != errTest {
|
||||
t.Fatalf("causual should be errTest, got: %v", cause)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue