1
0
Fork 0
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:
Sebastiaan van Stijn 2018-03-05 23:39:07 +01:00
parent 59854e407d
commit d48392a35b
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 14 additions and 1 deletions

View file

@ -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

View file

@ -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)
}
}