Fix definition of ErrSystem type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: d48392a35b157612d28c48eb8e4fad1272fa1442 Component: engine
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user