Skip to content

Commit d02b750

Browse files
committed
Improve an error message
1 parent c06e9b1 commit d02b750

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

agent/vendor/github.com/aws/amazon-ecs-agent/ecs-agent/utils/net/netutils_linux.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ecs-agent/utils/net/netutils_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func GetLoopbackInterface(nlWrapper netlinkwrapper.NetLink) (netlink.Link, error
198198
// - An error if ipFamily is invalid or if there's a problem accessing route information
199199
func GetDefaultNetworkInterface(nlWrapper netlinkwrapper.NetLink, ipFamily int) (netlink.Link, error) {
200200
if ipFamily != netlink.FAMILY_V4 && ipFamily != netlink.FAMILY_V6 {
201-
return nil, fmt.Errorf("ipFamily must be FAMILY_V4 or FAMILY_V6, got FAMILY_ALL")
201+
return nil, fmt.Errorf("ipFamily must be FAMILY_V4 or FAMILY_V6, got %d", ipFamily)
202202
}
203203

204204
// Get all routes
@@ -294,4 +294,4 @@ func FilterIPv6GlobalUnicast(ipAddrs []net.IP) []net.IP {
294294
}
295295
}
296296
return ipv6Addrs
297-
}
297+
}

ecs-agent/utils/net/netutils_linux_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ func TestGetDefaultNetworkInterface(t *testing.T) {
732732
ipFamily: netlink.FAMILY_ALL,
733733
setupMock: func(mockNl *mock_netlinkwrapper.MockNetLink) {
734734
},
735-
expectedError: fmt.Errorf("ipFamily must be FAMILY_V4 or FAMILY_V6, got FAMILY_ALL"),
735+
expectedError: fmt.Errorf("ipFamily must be FAMILY_V4 or FAMILY_V6, got 0"),
736736
},
737737
}
738738

@@ -1035,4 +1035,4 @@ func TestGetLinkGlobalIPAddrs(t *testing.T) {
10351035
}
10361036
})
10371037
}
1038-
}
1038+
}

0 commit comments

Comments
 (0)