diff --git a/candidate_test.go b/candidate_test.go index 23745b0..5889e9e 100644 --- a/candidate_test.go +++ b/candidate_test.go @@ -307,6 +307,7 @@ func TestCandidateMarshal(t *testing.T) { {nil, "4207374051 1 udp INVALID 10.0.75.1 53634 typ host", true}, {nil, "4207374051 INVALID udp 2130706431 10.0.75.1 INVALID typ host", true}, {nil, "4207374051 1 udp 2130706431 10.0.75.1 53634 typ INVALID", true}, + {nil, "4207374051 1 INVALID 2130706431 10.0.75.1 53634 typ host", true}, } { actualCandidate, err := UnmarshalCandidate(test.marshaled) if test.expectError { diff --git a/errors.go b/errors.go index 03a6a8e..8ca9c2c 100644 --- a/errors.go +++ b/errors.go @@ -112,6 +112,9 @@ var ( // ErrUnknownCandidateTyp indicates that a candidate had a unknown type value. ErrUnknownCandidateTyp = errors.New("unknown candidate typ") + // ErrDetermineNetworkType indicates that the NetworkType was not able to be parsed + ErrDetermineNetworkType = errors.New("unable to determine networkType") + errSendPacket = errors.New("failed to send packet") errAttributeTooShortICECandidate = errors.New("attribute not long enough to be ICE candidate") errParseComponent = errors.New("could not parse component") @@ -124,7 +127,6 @@ var ( errReadingStreamingPacket = errors.New("error reading streaming packet") errWriting = errors.New("error writing to") errClosingConnection = errors.New("error closing connection") - errDetermineNetworkType = errors.New("unable to determine networkType") errMissingProtocolScheme = errors.New("missing protocol scheme") errTooManyColonsAddr = errors.New("too many colons in address") errRead = errors.New("unexpected error trying to read") diff --git a/networktype.go b/networktype.go index 462ff2d..9509101 100644 --- a/networktype.go +++ b/networktype.go @@ -126,5 +126,5 @@ func determineNetworkType(network string, ip net.IP) (NetworkType, error) { return NetworkTypeTCP6, nil } - return NetworkType(0), fmt.Errorf("%w from %s %s", errDetermineNetworkType, network, ip) + return NetworkType(0), fmt.Errorf("%w from %s %s", ErrDetermineNetworkType, network, ip) }