forked from pion/srtp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
40 lines (34 loc) · 1.56 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package srtp
import (
"errors"
"fmt"
)
var (
errDuplicated = errors.New("duplicated packet")
errShortSrtpMasterKey = errors.New("SRTP master key is not long enough")
errShortSrtpMasterSalt = errors.New("SRTP master salt is not long enough")
errNoSuchSRTPProfile = errors.New("no such SRTP Profile")
errNonZeroKDRNotSupported = errors.New("indexOverKdr > 0 is not supported yet")
errExporterWrongLabel = errors.New("exporter called with wrong label")
errNoConfig = errors.New("no config provided")
errNoConn = errors.New("no conn provided")
errFailedToVerifyAuthTag = errors.New("failed to verify auth tag")
errTooShortRTCP = errors.New("packet is too short to be rtcp packet")
errPayloadDiffers = errors.New("payload differs")
errStartedChannelUsedIncorrectly = errors.New("started channel used incorrectly, should only be closed")
errStreamNotInited = errors.New("stream has not been inited, unable to close")
errStreamAlreadyClosed = errors.New("stream is already closed")
errStreamAlreadyInited = errors.New("stream is already inited")
errFailedTypeAssertion = errors.New("failed to cast child")
)
type errorDuplicated struct {
Proto string // srtp or srtcp
SSRC uint32
Index uint32 // sequence number or index
}
func (e *errorDuplicated) Error() string {
return fmt.Sprintf("%s ssrc=%d index=%d: %v", e.Proto, e.SSRC, e.Index, errDuplicated)
}
func (e *errorDuplicated) Unwrap() error {
return errDuplicated
}