move most errors into pkg/liberrors (#408)

This commit is contained in:
Alessandro Ros
2023-09-10 17:32:16 +02:00
committed by GitHub
parent 43e448d3fe
commit 4495e7d689
12 changed files with 178 additions and 131 deletions

View File

@@ -1188,13 +1188,13 @@ func TestServerRecordDecodeErrors(t *testing.T) {
{"udp", "rtp invalid"},
{"udp", "rtcp invalid"},
{"udp", "rtp packets lost"},
{"udp", "rtp unknown format"},
{"udp", "rtp unknown payload type"},
{"udp", "wrong ssrc"},
{"udp", "rtcp too big"},
{"udp", "rtp too big"},
{"tcp", "rtcp invalid"},
{"tcp", "rtp packets lost"},
{"tcp", "rtp unknown format"},
{"tcp", "rtp unknown payload type"},
{"tcp", "wrong ssrc"},
{"tcp", "rtcp too big"},
} {
@@ -1230,8 +1230,8 @@ func TestServerRecordDecodeErrors(t *testing.T) {
case ca.name == "rtcp invalid":
require.EqualError(t, ctx.Error, "rtcp: packet too short")
case ca.name == "rtp unknown format":
require.EqualError(t, ctx.Error, "received RTP packet with unknown format: 111")
case ca.name == "rtp unknown payload type":
require.EqualError(t, ctx.Error, "received RTP packet with unknown payload type: 111")
case ca.name == "wrong ssrc":
require.EqualError(t, ctx.Error, "received packet with wrong SSRC 456, expected 123")
@@ -1375,7 +1375,7 @@ func TestServerRecordDecodeErrors(t *testing.T) {
},
}))
case ca.name == "rtp unknown format":
case ca.name == "rtp unknown payload type":
writeRTP(mustMarshalPacketRTP(&rtp.Packet{
Header: rtp.Header{
PayloadType: 111,