forked from pion/webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
92 lines (73 loc) · 2.24 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package webrtc
import (
"errors"
"fmt"
)
// Types of InvalidStateErrors
var (
ErrConnectionClosed = errors.New("connection closed")
)
// InvalidStateError indicates the object is in an invalid state.
type InvalidStateError struct {
Err error
}
func (e *InvalidStateError) Error() string {
return fmt.Sprintf("invalid state error: %v", e.Err)
}
// Types of UnknownErrors
var (
ErrNoConfig = errors.New("no configuration provided")
)
// UnknownError indicates the operation failed for an unknown transient reason
type UnknownError struct {
Err error
}
func (e *UnknownError) Error() string {
return fmt.Sprintf("unknown error: %v", e.Err)
}
// Types of InvalidAccessErrors
var (
ErrCertificateExpired = errors.New("certificate expired")
ErrNoTurnCred = errors.New("turn server credentials required")
ErrTurnCred = errors.New("invalid turn server credentials")
ErrExistingTrack = errors.New("track aready exists")
)
// InvalidAccessError indicates the object does not support the operation or argument.
type InvalidAccessError struct {
Err error
}
func (e *InvalidAccessError) Error() string {
return fmt.Sprintf("invalid access error: %v", e.Err)
}
// Types of NotSupportedErrors
var ()
// NotSupportedError indicates the operation is not supported.
type NotSupportedError struct {
Err error
}
func (e *NotSupportedError) Error() string {
return fmt.Sprintf("not supported error: %v", e.Err)
}
// Types of InvalidModificationErrors
var (
ErrModPeerIdentity = errors.New("peer identity cannot be modified")
ErrModCertificates = errors.New("certificates cannot be modified")
ErrModRtcpMuxPolicy = errors.New("rtcp mux policy cannot be modified")
ErrModICECandidatePoolSize = errors.New("ice candidate pool size cannot be modified")
)
// InvalidModificationError indicates the object can not be modified in this way.
type InvalidModificationError struct {
Err error
}
func (e *InvalidModificationError) Error() string {
return fmt.Sprintf("invalid modification error: %v", e.Err)
}
// Types of SyntaxErrors
var ()
// SyntaxError indicates the string did not match the expected pattern.
type SyntaxError struct {
Err error
}
func (e *SyntaxError) Error() string {
return fmt.Sprintf("syntax error: %v", e.Err)
}