mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Replace errors.Cause() with errors.Is() / errors.As()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -312,7 +312,8 @@ func TestValidateContainerIsolation(t *testing.T) {
|
||||
func TestFindNetworkErrorType(t *testing.T) {
|
||||
d := Daemon{}
|
||||
_, err := d.FindNetwork("fakeNet")
|
||||
_, ok := errors.Cause(err).(libnetwork.ErrNoSuchNetwork)
|
||||
var nsn libnetwork.ErrNoSuchNetwork
|
||||
ok := errors.As(err, &nsn)
|
||||
if !errdefs.IsNotFound(err) || !ok {
|
||||
t.Error("The FindNetwork method MUST always return an error that implements the NotFound interface and is ErrNoSuchNetwork")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user